trustednetwork

package
v2.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Client *zpa.Client
}

func New

func New(c *zpa.Client) *Service

func (*Service) Get

func (service *Service) Get(networkID string) (*TrustedNetwork, *http.Response, error)

func (*Service) GetAll

func (service *Service) GetAll() ([]TrustedNetwork, *http.Response, error)
func (service *Service) GetByName(trustedNetworkName string) (*TrustedNetwork, *http.Response, error) {
	adaptedTrustedNetworkName := common.RemoveCloudSuffix(trustedNetworkName)
	adaptedTrustedNetworkName = strings.ReplaceAll(adaptedTrustedNetworkName, "-", " ")
	adaptedTrustedNetworkName = strings.TrimSpace(adaptedTrustedNetworkName)
	adaptedTrustedNetworkName = strings.Split(adaptedTrustedNetworkName, " ")[0]
	relativeURL := mgmtConfig + service.Client.Config.CustomerID + trustedNetworkEndpoint
	list, resp, err := common.GetAllPagesGeneric[TrustedNetwork](service.Client, relativeURL, adaptedTrustedNetworkName)
	if err != nil {
		return nil, nil, err
	}
	for _, trustedNetwork := range list {
		if strings.EqualFold(common.RemoveCloudSuffix(trustedNetwork.Name), common.RemoveCloudSuffix(trustedNetworkName)) {
			return &trustedNetwork, resp, nil
		}
	}
	return nil, resp, fmt.Errorf("no trusted network named '%s' was found", trustedNetworkName)
}

func (*Service) GetByName

func (service *Service) GetByName(trustedNetworkName string) (*TrustedNetwork, *http.Response, error)

func (*Service) GetByNetID

func (service *Service) GetByNetID(netID string) (*TrustedNetwork, *http.Response, error)

type TrustedNetwork

type TrustedNetwork struct {
	CreationTime     string `json:"creationTime,omitempty"`
	Domain           string `json:"domain,omitempty"`
	ID               string `json:"id,omitempty"`
	MasterCustomerID string `json:"masterCustomerId,omitempty"`
	ModifiedBy       string `json:"modifiedBy,omitempty"`
	ModifiedTime     string `json:"modifiedTime,omitempty"`
	Name             string `json:"name,omitempty"`
	NetworkID        string `json:"networkId,omitempty"`
	ZscalerCloud     string `json:"zscalerCloud,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL