Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
4176 lines (3593 sloc) 165 KB
/* Copyright © 2017 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: BSD-2-Clause
Generated by: https://github.com/swagger-api/swagger-codegen.git */
package nsxt
import (
"context"
"encoding/json"
"fmt"
"github.com/vmware/go-vmware-nsxt/policy"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type PolicyApiService service
/* PolicyApiService Create a new Domain Deployment Map under infra
If the passed Domain Deployment Map does not already exist, create a new Domain Deployment Map. If it already exist, replace it.
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param domainDeploymentMapId Domain Deployment Map ID
@param domainDeploymentMap
@return DomainDeploymentMap*/
func (a *PolicyApiService) CreateOrUpdateDomainDeploymentMapForInfra(ctx context.Context, domainId string, domainDeploymentMapId string, domainDeploymentMap policy.DomainDeploymentMap) (policy.DomainDeploymentMap, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.DomainDeploymentMap
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/domain-deployment-maps/{domain-deployment-map-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"domain-deployment-map-id"+"}", fmt.Sprintf("%v", domainDeploymentMapId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &domainDeploymentMap
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Create/update a new Enforcement Point under infra
If the passed Enforcement Point does not already exist, create a new Enforcement Point. If it already exists, replace it.
* @param ctx context.Context Authentication Context
@param deploymentZoneId Deployment zone id
@param enforcementpointId EnforcementPoint id
@param enforcementPoint
@return EnforcementPoint*/
func (a *PolicyApiService) CreateOrUpdateEnforcementPointForInfra(ctx context.Context, deploymentZoneId string, enforcementpointId string, enforcementPoint policy.EnforcementPoint) (policy.EnforcementPoint, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.EnforcementPoint
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}"
localVarPath = strings.Replace(localVarPath, "{"+"deployment-zone-id"+"}", fmt.Sprintf("%v", deploymentZoneId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"enforcementpoint-id"+"}", fmt.Sprintf("%v", enforcementpointId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &enforcementPoint
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Create or update a template.
Create a new template if the specified template id does not correspond to an existing template. Update the template if otherwise.
* @param ctx context.Context Authentication Context
@param templateId Template identifier
@param policyTemplate
@return PolicyTemplate*/
func (a *PolicyApiService) CreateOrUpdateTemplate(ctx context.Context, templateId string, policyTemplate policy.PolicyTemplate) (policy.PolicyTemplate, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.PolicyTemplate
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/templates/{template-id}"
localVarPath = strings.Replace(localVarPath, "{"+"template-id"+"}", fmt.Sprintf("%v", templateId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &policyTemplate
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Delete CommunicationEntry
Delete CommunicationEntry
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param communicationEntryId CommunicationEntry ID
@return */
func (a *PolicyApiService) DeleteCommunicationEntry(ctx context.Context, domainId string, communicationEntryId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/communication-map/communication-entries/{communication-entry-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"communication-entry-id"+"}", fmt.Sprintf("%v", communicationEntryId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete CommunicationProfile
Delete CommunicationProfile
* @param ctx context.Context Authentication Context
@param communicationProfileId CommunicationProfile ID
@return */
func (a *PolicyApiService) DeleteCommunicationProfile(ctx context.Context, communicationProfileId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/communication-profiles/{communication-profile-id}"
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-id"+"}", fmt.Sprintf("%v", communicationProfileId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete CommunicationProfileEntry
Delete CommunicationProfileEntry
* @param ctx context.Context Authentication Context
@param communicationProfileId CommunicationProfile ID
@param communicationProfileEntryId CommunicationProfileEntry ID
@return */
func (a *PolicyApiService) DeleteCommunicationProfileEntry(ctx context.Context, communicationProfileId string, communicationProfileEntryId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/communication-profiles/{communication-profile-id}/communication-profile-entries/{communication-profile-entry-id}"
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-id"+"}", fmt.Sprintf("%v", communicationProfileId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-entry-id"+"}", fmt.Sprintf("%v", communicationProfileEntryId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete Domain and all the entities contained by this domain
Delete the domain along with all the entities contained by this domain. The groups that are a part of this domain are also deleted along with the domain.
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@return */
func (a *PolicyApiService) DeleteDomain(ctx context.Context, domainId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete Domain Deployment Map
Delete Domain Deployment Map
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param domainDeploymentMapId domain-deployment-map-id
@return */
func (a *PolicyApiService) DeleteDomainDeploymentMap(ctx context.Context, domainId string, domainDeploymentMapId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/domain-deployment-maps/{domain-deployment-map-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"domain-deployment-map-id"+"}", fmt.Sprintf("%v", domainDeploymentMapId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete EnforcementPoint
Delete EnforcementPoint
* @param ctx context.Context Authentication Context
@param deploymentZoneId Deployment zone id
@param enforcementpointId enforcementpoint-id
@return */
func (a *PolicyApiService) DeleteEnforcementPoint(ctx context.Context, deploymentZoneId string, enforcementpointId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}"
localVarPath = strings.Replace(localVarPath, "{"+"deployment-zone-id"+"}", fmt.Sprintf("%v", deploymentZoneId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"enforcementpoint-id"+"}", fmt.Sprintf("%v", enforcementpointId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete Group
Delete Group
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param groupId Group ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "force" (bool) Force delete the resource even if it is being used somewhere
@return */
func (a *PolicyApiService) DeleteGroup(ctx context.Context, domainId string, groupId string, localVarOptionals map[string]interface{}) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/groups/{group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", fmt.Sprintf("%v", groupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["force"], "bool", "force"); err != nil {
return nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["force"].(bool); localVarOk {
localVarQueryParams.Add("force", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete Service entry
Delete Service entry
* @param ctx context.Context Authentication Context
@param serviceId Service ID
@param serviceEntryId Service entry ID
@return */
func (a *PolicyApiService) DeleteServiceEntry(ctx context.Context, serviceId string, serviceEntryId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/services/{service-id}/service-entries/{service-entry-id}"
localVarPath = strings.Replace(localVarPath, "{"+"service-id"+"}", fmt.Sprintf("%v", serviceId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"service-entry-id"+"}", fmt.Sprintf("%v", serviceEntryId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete Service
Delete Service
* @param ctx context.Context Authentication Context
@param serviceId Service ID
@return */
func (a *PolicyApiService) DeleteServiceForTenant(ctx context.Context, serviceId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/services/{service-id}"
localVarPath = strings.Replace(localVarPath, "{"+"service-id"+"}", fmt.Sprintf("%v", serviceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Delete template.
Delete a template.
* @param ctx context.Context Authentication Context
@param templateId Template identifier
@return */
func (a *PolicyApiService) DeleteTemplate(ctx context.Context, templateId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/templates/{template-id}"
localVarPath = strings.Replace(localVarPath, "{"+"template-id"+"}", fmt.Sprintf("%v", templateId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
return localVarHttpResponse, err
}
/* PolicyApiService Deploy template.
Read a template, populate the placeholders' fields with the parameters' values, and deploy the template body by creating or updating all the nested policy objects inside the AbstractSpace object.
* @param ctx context.Context Authentication Context
@param templateId Template identifier
@param policyTemplateParameters
@return AbstractSpace*/
func (a *PolicyApiService) DeployTemplateDeploy(ctx context.Context, templateId string, policyTemplateParameters policy.PolicyTemplateParameters) (policy.AbstractSpace, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.AbstractSpace
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/templates/{template-id}?action=deploy"
localVarPath = strings.Replace(localVarPath, "{"+"template-id"+"}", fmt.Sprintf("%v", templateId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &policyTemplateParameters
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List CommunicationEntries
List CommunicationEntries
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return CommunicationEntryListResult*/
func (a *PolicyApiService) ListCommunicationEntry(ctx context.Context, domainId string, localVarOptionals map[string]interface{}) (policy.CommunicationEntryListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationEntryListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/communication-map/communication-entries"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List CommunicationProfileEntries for CommunicationProfile
Paginated list of CommunicationProfileEntries for the given CommunicationProfile.
* @param ctx context.Context Authentication Context
@param communicationProfileId CommunicationProfile ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return CommunicationProfileEntryListResult*/
func (a *PolicyApiService) ListCommunicationProfileEntries(ctx context.Context, communicationProfileId string, localVarOptionals map[string]interface{}) (policy.CommunicationProfileEntryListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationProfileEntryListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/communication-profiles/{communication-profile-id}/communication-profile-entries"
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-id"+"}", fmt.Sprintf("%v", communicationProfileId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List CommunicationProfiles
Paginated list of CommunicationProfiles.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return CommunicationProfileListResult*/
func (a *PolicyApiService) ListCommunicationProfiles(ctx context.Context, localVarOptionals map[string]interface{}) (policy.CommunicationProfileListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationProfileListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/communication-profiles"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Deployment Zones for infra
Paginated list of all Deployment zones for infra.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return DeploymentZoneListResult*/
func (a *PolicyApiService) ListDeploymentZonesForInfra(ctx context.Context, localVarOptionals map[string]interface{}) (policy.DeploymentZoneListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.DeploymentZoneListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/deployment-zones"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Domain Deployment maps for infra
Paginated list of all Domain Deployment Entries for infra.
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return DomainDeploymentMapListResult*/
func (a *PolicyApiService) ListDomainDeploymentMapsForInfra(ctx context.Context, domainId string, localVarOptionals map[string]interface{}) (policy.DomainDeploymentMapListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.DomainDeploymentMapListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/domain-deployment-maps"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List domains for infra
Paginated list of all domains for infra.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return DomainListResult*/
func (a *PolicyApiService) ListDomainForInfra(ctx context.Context, localVarOptionals map[string]interface{}) (policy.DomainListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.DomainListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List enforcementpoints for infra
Paginated list of all enforcementpoints for infra.
* @param ctx context.Context Authentication Context
@param deploymentZoneId
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return EnforcementPointListResult*/
func (a *PolicyApiService) ListEnforcementPointForInfra(ctx context.Context, deploymentZoneId string, localVarOptionals map[string]interface{}) (policy.EnforcementPointListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.EnforcementPointListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/deployment-zones/{deployment-zone-id}/enforcement-points"
localVarPath = strings.Replace(localVarPath, "{"+"deployment-zone-id"+"}", fmt.Sprintf("%v", deploymentZoneId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Enforcement Points
Paginated list of all enforcement points. Returns the populated enforcement points.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return RealizedEnforcementPointListResult*/
func (a *PolicyApiService) ListEnforcementPointRealizedStates(ctx context.Context, localVarOptionals map[string]interface{}) (policy.RealizedEnforcementPointListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedEnforcementPointListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Firewall Sections
Paginated list of all Firewalls. Returns populated Firewalls.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return RealizedFirewallSectionListResult*/
func (a *PolicyApiService) ListFirewallSectionRealizedStates(ctx context.Context, enforcementPointName string, localVarOptionals map[string]interface{}) (policy.RealizedFirewallSectionListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedFirewallSectionListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/firewalls/firewall-sections"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Groups for a domain
List Groups for a domain
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return GroupListResult*/
func (a *PolicyApiService) ListGroupForDomain(ctx context.Context, domainId string, localVarOptionals map[string]interface{}) (policy.GroupListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.GroupListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/groups"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List NS Groups
Paginated list of all NSGroups. Returns populated NSGroups.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return RealizedNsGroupListResult*/
func (a *PolicyApiService) ListNSGroupRealizedStates(ctx context.Context, enforcementPointName string, localVarOptionals map[string]interface{}) (policy.RealizedNsGroupListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedNsGroupListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/groups/nsgroups"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Realized NSServices
Paginated list of all Realized NSService.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return RealizedNsServiceListResult*/
func (a *PolicyApiService) ListNSServiceRealizedStates(ctx context.Context, enforcementPointName string, localVarOptionals map[string]interface{}) (policy.RealizedNsServiceListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedNsServiceListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/services/nsservices"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Security Groups
Paginated list of all Security Groups. Returns populated Security Groups.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return RealizedSecurityGroupListResult*/
func (a *PolicyApiService) ListSecurityGroupRealizedStates(ctx context.Context, enforcementPointName string, localVarOptionals map[string]interface{}) (policy.RealizedSecurityGroupListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedSecurityGroupListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/groups/securitygroups"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Service entries for the given service
Paginated list of Service entries for the given service
* @param ctx context.Context Authentication Context
@param serviceId Service ID
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return ServiceEntryListResult*/
func (a *PolicyApiService) ListServiceEntries(ctx context.Context, serviceId string, localVarOptionals map[string]interface{}) (policy.ServiceEntryListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.ServiceEntryListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/services/{service-id}/service-entries"
localVarPath = strings.Replace(localVarPath, "{"+"service-id"+"}", fmt.Sprintf("%v", serviceId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Services for infra
Paginated list of Services for infra.
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return ServiceListResult*/
func (a *PolicyApiService) ListServicesForTenant(ctx context.Context, localVarOptionals map[string]interface{}) (policy.ServiceListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.ServiceListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/services"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService List Policy Templates
List Policy Templates
* @param ctx context.Context Authentication Context
@param optional (nil or map[string]interface{}) with one or more of:
@param "cursor" (string) Opaque cursor to be used for getting next page of records (supplied by current result page)
@param "includedFields" (string) Comma separated list of fields that should be included to result of query
@param "pageSize" (int64) Maximum number of results to return in this page (server may return fewer)
@param "sortAscending" (bool)
@param "sortBy" (string) Field by which records are sorted
@return PolicyTemplateListResult*/
func (a *PolicyApiService) ListTemplates(ctx context.Context, localVarOptionals map[string]interface{}) (policy.PolicyTemplateListResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.PolicyTemplateListResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/templates"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["cursor"], "string", "cursor"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includedFields"], "string", "includedFields"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["pageSize"], "int64", "pageSize"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortAscending"], "bool", "sortAscending"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["sortBy"], "string", "sortBy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["cursor"].(string); localVarOk {
localVarQueryParams.Add("cursor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includedFields"].(string); localVarOk {
localVarQueryParams.Add("included_fields", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["pageSize"].(int64); localVarOk {
localVarQueryParams.Add("page_size", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortAscending"].(bool); localVarOk {
localVarQueryParams.Add("sort_ascending", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["sortBy"].(string); localVarOk {
localVarQueryParams.Add("sort_by", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read CommunicationEntry
Read CommunicationEntry
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param communicationEntryId CommunicationEntry ID
@return CommunicationEntry*/
func (a *PolicyApiService) ReadCommunicationEntry(ctx context.Context, domainId string, communicationEntryId string) (policy.CommunicationEntry, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/communication-map/communication-entries/{communication-entry-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"communication-entry-id"+"}", fmt.Sprintf("%v", communicationEntryId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read communication-map
Read communication-map for a domain.
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@return CommunicationMap*/
func (a *PolicyApiService) ReadCommunicationMapForDomain(ctx context.Context, domainId string) (policy.CommunicationMap, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationMap
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/communication-map"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read CommunicationProfile
Read a CommunicationProfile.
* @param ctx context.Context Authentication Context
@param communicationProfileId CommunicationProfile ID
@return CommunicationProfile*/
func (a *PolicyApiService) ReadCommunicationProfile(ctx context.Context, communicationProfileId string) (policy.CommunicationProfile, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationProfile
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/communication-profiles/{communication-profile-id}"
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-id"+"}", fmt.Sprintf("%v", communicationProfileId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read CommunicationProfileEntry
Read CommunicationProfileEntry
* @param ctx context.Context Authentication Context
@param communicationProfileId CommunicationProfile ID
@param communicationProfileEntryId CommunicationProfileEntry ID
@return CommunicationProfileEntry*/
func (a *PolicyApiService) ReadCommunicationProfileEntry(ctx context.Context, communicationProfileId string, communicationProfileEntryId string) (policy.CommunicationProfileEntry, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.CommunicationProfileEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/communication-profiles/{communication-profile-id}/communication-profile-entries/{communication-profile-entry-id}"
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-id"+"}", fmt.Sprintf("%v", communicationProfileId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"communication-profile-entry-id"+"}", fmt.Sprintf("%v", communicationProfileEntryId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read a DeploymentZone
Read a Deployment Zone
* @param ctx context.Context Authentication Context
@param deploymentZoneId Deployment Zone id
@return DeploymentZone*/
func (a *PolicyApiService) ReadDeploymentZoneInfra(ctx context.Context, deploymentZoneId string) (policy.DeploymentZone, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.DeploymentZone
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/deployment-zones/{deployment-zone-id}"
localVarPath = strings.Replace(localVarPath, "{"+"deployment-zone-id"+"}", fmt.Sprintf("%v", deploymentZoneId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read a DomainDeploymentMap
Read a Domain Deployment Map
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param domainDeploymentMapId Domain Deployment Map id
@return DomainDeploymentMap*/
func (a *PolicyApiService) ReadDomainDeploymentMapForInfra(ctx context.Context, domainId string, domainDeploymentMapId string) (policy.DomainDeploymentMap, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.DomainDeploymentMap
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/domain-deployment-maps/{domain-deployment-map-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"domain-deployment-map-id"+"}", fmt.Sprintf("%v", domainDeploymentMapId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read domain
Read a domain.
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@return Domain*/
func (a *PolicyApiService) ReadDomainForInfra(ctx context.Context, domainId string) (policy.Domain, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.Domain
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read an Enforcement Point
Read an Enforcement Point
* @param ctx context.Context Authentication Context
@param deploymentZoneId Deployment zone id
@param enforcementpointId EnforcementPoint id
@return EnforcementPoint*/
func (a *PolicyApiService) ReadEnforcementPointForInfra(ctx context.Context, deploymentZoneId string, enforcementpointId string) (policy.EnforcementPoint, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.EnforcementPoint
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}"
localVarPath = strings.Replace(localVarPath, "{"+"deployment-zone-id"+"}", fmt.Sprintf("%v", deploymentZoneId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"enforcementpoint-id"+"}", fmt.Sprintf("%v", enforcementpointId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read Enforcement Point
Read a Enforcement Point and the complete tree underneath. Returns the populated enforcement point object.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@return RealizedEnforcementPoint*/
func (a *PolicyApiService) ReadEnforcementPointRealizedState(ctx context.Context, enforcementPointName string) (policy.RealizedEnforcementPoint, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedEnforcementPoint
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read Firewall
Read a Firewall and the complete tree underneath. Returns the populated Firewall object.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param firewallSectionId Firewall Section Id
@return RealizedFirewallSection*/
func (a *PolicyApiService) ReadFirewallSectionRealizedState(ctx context.Context, enforcementPointName string, firewallSectionId string) (policy.RealizedFirewallSection, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedFirewallSection
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/firewalls/firewall-sections/{firewall-section-id}"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarPath = strings.Replace(localVarPath, "{"+"firewall-section-id"+"}", fmt.Sprintf("%v", firewallSectionId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read group
Read group
* @param ctx context.Context Authentication Context
@param domainId Domain ID
@param groupId Group ID
@return Group*/
func (a *PolicyApiService) ReadGroupForDomain(ctx context.Context, domainId string, groupId string) (policy.Group, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.Group
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/domains/{domain-id}/groups/{group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"domain-id"+"}", fmt.Sprintf("%v", domainId), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", fmt.Sprintf("%v", groupId), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read infra
Read infra. Returns only the infra related properties. Inner object are not populated.
* @param ctx context.Context Authentication Context
@return Infra*/
func (a *PolicyApiService) ReadInfra(ctx context.Context) (policy.Infra, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.Infra
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read Group
Read a NSGroup and the complete tree underneath. Returns the populated NSgroup object.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param nsgroupName Group Name
@return RealizedNsGroup*/
func (a *PolicyApiService) ReadNSGroupRealizedState(ctx context.Context, enforcementPointName string, nsgroupName string) (policy.RealizedNsGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedNsGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/groups/nsgroups/{nsgroup-name}"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarPath = strings.Replace(localVarPath, "{"+"nsgroup-name"+"}", fmt.Sprintf("%v", nsgroupName), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* PolicyApiService Read NSService
Read a NSService.
* @param ctx context.Context Authentication Context
@param enforcementPointName Enforcement Point Name
@param nsserviceName NSService Name
@return RealizedNsService*/
func (a *PolicyApiService) ReadNSServiceRealizedState(ctx context.Context, enforcementPointName string, nsserviceName string) (policy.RealizedNsService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload policy.RealizedNsService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/infra/realized-state/enforcement-points/{enforcement-point-name}/services/nsservices/{nsservice-name}"
localVarPath = strings.Replace(localVarPath, "{"+"enforcement-point-name"+"}", fmt.Sprintf("%v", enforcementPointName), -1)
localVarPath = strings.Replace(localVarPath, "{"+"nsservice-name"+"}", fmt.Sprintf("%v", nsserviceName), -1)