# Packages
# README
github.com/speakeasy-sdks/testpan-go
SDK Installation
go get github.com/speakeasy-sdks/testpan-go
SDK Example Usage
Example
package main
import (
"context"
testpango "github.com/speakeasy-sdks/testpan-go"
"github.com/speakeasy-sdks/testpan-go/pkg/models/operations"
"github.com/speakeasy-sdks/testpan-go/pkg/models/shared"
"log"
)
func main() {
s := testpango.New(
testpango.WithSecurity(shared.Security{
Password: testpango.String("<YOUR_PASSWORD_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Users.DeleteUsersUserID(ctx, operations.DeleteUsersUserIDRequest{
UserID: "2d4aef6d-76db-4c57-a2a3-fe8efd3db6e2",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Available Resources and Operations
Users
- DeleteUsersUserID - Delete a user
- GetOperatorCredentials - get the credentials of the Secure Application Operator service user
- GetUsers - List current users
- GetUsersUserIDAccessTokens - Get the access tokens for the user
- GetUsersUserIDDeleteDependencies - get dependencies which need to be handled in order to delete specified user
- PostAccountUsageStatus - an api to get the account usage status
- PostChangePassword - Change the password for the current user
- PostLogin - Login
- PostLogout - Log out
- PostMe - an api to get current logged in user info
- PostUsers - Create a user
- PostUsersAcceptEula - Accept the EULA
- PostUsersTrial - Create a trail user
- PutUsersUserID - Change user details
ImagesAndVulnerabilities
- DeleteImagesID - Delete an image hash
- GetAccountVulnerabilitiesXlsx - Returns a xlsx file of images alongside to their vulnerabilities.
- GetImages - Returns a list of images
- GetImagesImagesHash - search for image hash in the account
- GetImagesVulnerabilitiesByImageNameAndHash - Returns a list of vulnerabilities detected in the image
- GetImagesID - get an image
- GetImagesImageIDDockerfileScanResults - Returns a list of vulnerabilities detected in the image
- GetImagesImageIDImageLayers - Returns a list of image layers
- GetImagesImageIDPackages - Returns a list of packages for a specific image
- GetImagesImageIDSbomPath - Returns the path to the SBOM in cloud storage
- GetImagesImageIDVulnerabilities - Returns a list of vulnerabilities detected in the image
- PostImages - Define a New image hash
- PostImagesApprove - Approve an image hash
- PostImagesImageIDDockerfileScanResultsIgnore - Add / remove a list of UUIDs of dockerfileScanResults from ignored list
- PostImagesImageIDVulnerabilitiesIgnore - Add / remove a list of UUIDs of vulnerabilities from ignored list
Advisor
- GetAdvisorClusterEventRules - Returns a list of suggested cluster event rules
- GetAdvisorConnectionRules - Returns a list of suggested connection rules
- GetAdvisorEnvironment - Returns a list of suggested kubernetes environments
- GetAdvisorEnvironmentRules - Returns a list of suggested environment rules
- GetAdvisorPodSecurityPolicy - Returns a list of suggested kubernetes Pod Security Standards
- GetAdvisorQueueAdvisorType - Get status for policy advisor background job
- PostAdvisorRun - Runs the policy advisor
AgentManagement
- GetAgents - List all installed agents
- PostAgentsAgentIDUpdate - Update the agent with the given id to the latest agent version
- PostAgentsAgentIDUpdateState - Update the status of an agent with the given id
API
- GetAPI - Get Secure Application API as a Swagger file
APISecurity
- DeleteAPISecurityAPICatalogID - Delete an API
- DeleteAPISecurityInternalCatalogCatalogIDBflaDetection - stop bfla detection phase
- DeleteAPISecurityInternalCatalogCatalogIDBflaLearning - stop bfla learning phase
- DeleteAPISecurityOpenAPISpecsCatalogID - delete open api spec include all of it findings and scores
- DeleteGatewaysGatewayID - Delete gateway
- GetAPISecurityExternalCatalog - Get a list of APIs and their compliance
- GetAPISecurityExternalCatalogCount - Get the number of existing 3rd party APIs in the inventory
- GetAPISecurityExternalCatalogCatalogID - Get information about a specific API
- GetAPISecurityInternalCatalog - Get a list of APIs and their compliance
- GetAPISecurityInternalCatalogCount - Get the number of existing 3rd party APIs in the inventory
- GetAPISecurityInternalCatalogCatalogID - Get information about a specific API
- GetAPISecurityInternalCatalogCatalogIDBfla - Get bfla info for given catalogId
- GetAPISecurityInternalCatalogCatalogIDFuzzingStatus - Get status of the last/running fuzzing test
- GetAPISecurityInternalCatalogCatalogIDFuzzingTests - Get list of fuzzing tests
- GetAPISecurityInternalCatalogCatalogIDTraceAnalysis - Get trace analysis details
- GetAPISecurityOpenAPISpecsCatalogID - Get provided and reconstructed open api specs for specific API
- GetAPISecurityOpenAPISpecsCatalogIDDiffDetectionStatus - Get provided and reconstructed open api specs for specific API
- GetAPISecurityOpenAPISpecsCatalogIDGetOpenAPISpecScoreStatus - Get open api spec score status
- GetAPISecurityOpenAPISpecsCatalogIDOpenAPISpecSwaggerJSON - Get provided spec content as json
- GetAPISecurityOpenAPISpecsCatalogIDReconstructedSpecReview - Get the suggestions of a spec reconstruction (or previously cached info)
- GetAPISecurityOpenAPISpecsCatalogIDReconstructedSpecStatus - Get the status of a spec reconstruction
- GetAPISecurityOpenAPISpecsCatalogIDReconstructedSpecJSON - Get reconstructed open api spec as json for specific API
- GetAPISecurityRiskFindings - Get a list of risk findings
- GetAPISecurityRiskFindingsCategories - Get a list of risk findings categories
- GetAPISecurityRiskFindingsSources - Get a list of risk findings sources
- GetAPISecurityRiskFindingsRiskFindingID - Get a specific risk findings
- GetAPISecurityCatalogIDDeleteDependencies - get dependencies which need to be handled in order to delete specified api security service
- GetAPISecurityCatalogIDMethods - Get a list of an API spec methods for a specific API and its spec's tags
- GetAPISecurityCatalogIDTags - Get a list of an API spec tags or a specific API
- GetDashboardApisecRiskFindings - Get API sec risk findings widget
- GetDashboardApisecRiskFindingsTrend - Get API sec risk findings trend graph widget for the last 30 days
- GetDashboardApisecSpecsAndOperationsDiffs - Get API sec specs and operations diffs widget
- GetDashboardApisecTopRiskyApis - Get API sec top risky APIs widget
- GetDashboardApisecTopRiskyFindings - Get API sec top risky findings widget
- GetGateways - Get gateways
- GetGatewaysClusters - Get clusters info
- GetGatewaysGatewayIDDownloadBundle - Get a GW installation script
- PostAPISecurityAPI - Register an API for scoring
- PostAPISecurityInternalCatalogCatalogIDBflaDetection - Start new bfla detection phase
- PostAPISecurityInternalCatalogCatalogIDBflaLearning - Start new bfla learning phase
- PostAPISecurityInternalCatalogCatalogIDBflaReset - Reset bfla model
- PostAPISecurityInternalCatalogCatalogIDResetTraceAnalysis - Reset trace analysis
- PostAPISecurityInternalCatalogCatalogIDStartFuzzing - Start new fuzzing test
- PostAPISecurityInternalCatalogCatalogIDStartTraceAnalysis - Start trace analysis
- PostAPISecurityInternalCatalogCatalogIDStopFuzzing - Stop fuzzing test
- PostAPISecurityInternalCatalogCatalogIDStopTraceAnalysis - Stop trace analysis
- PostAPISecurityOpenAPISpecsCatalogIDReconstructedSpecAbort - abort learning and reconstructing an API via API Clarity
- PostAPISecurityOpenAPISpecsCatalogIDReconstructedSpecLearn - Start learning and reconstructing an API via API Clarity
- PostAPISecurityOpenAPISpecsCatalogIDReconstructedSpecReviewApprove - Approve reconstructed spec suggestions (only 1 approval per catalogId)
- PostAPISecurityOpenAPISpecsCatalogIDStartDiffsDetection - Start spec diffs detection
- PostAPISecurityOpenAPISpecsCatalogIDStopDiffsDetection - stop spec diffs detection
- PostGateways - Add new gateway
- PutAPISecurityInternalCatalogCatalogIDBfla - update BFLA info for this catalogId
- PutAPISecurityOpenAPISpecsCatalogID - Add or edit a spec about a specific API for the account
- PutGatewaysGatewayID - Edit gateway
Performance
- GetAPISecurityAPICatalogIDHitCountGraph - Get hit count for specific spec path
- GetPerformanceMetrics - Get performance metrics for a connection between workloads
Bfla
- DeleteAPISecurityInternalCatalogCatalogIDBflaDetection - stop bfla detection phase
- DeleteAPISecurityInternalCatalogCatalogIDBflaLearning - stop bfla learning phase
- GetAPISecurityInternalCatalogCatalogIDBfla - Get bfla info for given catalogId
- PostAPISecurityInternalCatalogCatalogIDBflaDetection - Start new bfla detection phase
- PostAPISecurityInternalCatalogCatalogIDBflaLearning - Start new bfla learning phase
- PostAPISecurityInternalCatalogCatalogIDBflaReset - Reset bfla model
- PutAPISecurityInternalCatalogCatalogIDBfla - update BFLA info for this catalogId
APISecurityPolicies
- DeleteAPISecurityPolicyPolicyID - Delete api security policy
- GetAPISecurityPolicy - Get a list of API security policies
- GetAPISecurityPolicyPolicyIDDeleteDependencies - get dependencies which need to be handled in order to delete specified api security service
- PostAPISecurityPolicy - Add new API security policy
- PutAPISecurityPolicyPolicyID - Edit Api security policy.
Telemetries
- GetAppTelemetries - Get App telemetries
- GetAppTelemetriesAppTelemetryID - Get App telemetry by ID
- GetAppTelemetriesAppTelemetryIDAPIRiskInfo - Get API risks info of given app telemetry
- GetAppTelemetriesAppTelemetryIDImagePackages - list packages with licenses runnin on a pod
- GetAppTelemetriesAppTelemetryIDInjectionInfo - Get token injection info of given app telemetry
- GetConnectionTelemetries - Get connection telemetries
- GetConnectionTelemetriesConnectionTelemetryID - get details for a single connection telemetry
Apps
- GetApps - Returns a list of defined Apps
- GetAppsAppID - Returns an App by its ID
- PostApps - Define a New App
- PostAppsDelete - Delete several Apps
- PutAppsAppID - Edit the existing App
EnvironmentPolicies
- GetAppsPolicy - Get the current Apps policy
- GetAppsPolicyHistory - Get the history of Apps policies
- GetAppsPolicySearchOptions - Get the current Apps policy filter option
- PutAppsPolicy - Set the current Apps policy
AuditLogs
- GetAuditLogs - Get audit logs
- GetAuditLogsActions - Get all the audit logs actions
- GetAuditLogsKubernetes - Get audit logs
- GetAuditLogsKubernetesActions - Get all the kubernetes audit logs actions
Aws
- GetAwsAccounts - Get a list of AWS accounts
- GetAwsRoles - Lists AWS role ARNs for the account
- GetAwsTags - Get a list of AWS tag keys
- GetAwsAwsAccountIDRegions - Get a list of regions for the AWS account
- GetAwsAwsAccountIDRegionIDSubnets - Get a list of AWS subnets for an AWS account and region
- GetAwsAwsAccountIDRegionIDVpcs - Get a list of VPCs for AWS accounts.
- PostAwsRoles - Add AWS role to the account
- PutAwsRolesRoleID - Change AWS role name
Cd
- DeleteCdRuleIDConnectionsRule - delete a cd connection rule.
- DeleteCdRuleIDServerlessRule - delete a cd serverless rule.
- GetCd - Get all the CD pipelines results
- GetCdResourceID - Get A single CD pipeline results
- GetCdRuleIDConnectionsRule - get a cd connection rule.
- GetCdRuleIDServerlessRule - get a cd serverless rule.
- PostCdConnectionsRule - Adds cd connection rule.
- PostCdServerlessRule - Adds cd serverless rule.
- PutCdRuleIDConnectionsRule - update a cd connection rule.
- PutCdRuleIDServerlessRule - update a cd serverless rule.
CICDPolicies
- DeleteCdPolicyPolicyID - Delete CD policy
- DeleteCiPolicyPolicyID - Delete CI policy
- GetCdPolicy - Get the current CD policy
- GetCiPolicy - Get the current CI policy
- PostCdPolicy - Set the current CD policy. At least one CdPolicyElement should be present
- PostCiPolicy - Set the current CI policy
- PutCdPolicyPolicyID - Edit CD policy. At least one CdPolicyElement should be present
- PutCiPolicyPolicyID - Edit CI policy
Serverless
- DeleteCloudAccountsCloudAccountID - Delete a cloud account
- GetCloudAccounts - List all the cloud accounts on the system
- GetCloudAccountsAzureInstallationDetails - Get the Azure installation details
- GetCloudAccountsInstallationDetails - Get the installation details
- GetCloudAccountsRegionsAWS - List all the possible regions of AWS
- GetCloudAccountsRegionsAzure - List all the possible regions of Azure
- GetCloudAccountsCloudAccountIDDeleteDependencies - get dependencies which need to be handled in order to delete specified cloud account
- GetCloudAccountsCloudAccountIDDownloadBundle - Get Secure Application installation script
- GetServerlessFunctions - Get serverless functions
- GetServerlessFunctionsArns - Get serverless functions names
- GetServerlessFunctionsNames - Get serverless functions names
- GetServerlessFunctionsFunctionID - Get Serverless Function by ID
- GetServerlessFunctionsFunctionIDSecrets - Get Serverless Function secrets issues
- GetServerlessFunctionsFunctionIDVulnerabilities - Get Serverless Function Vulnerabilities by ID
- GetServerlessZipFiles - Get serverless zip files that was scanned by cli
- GetServerlessZipFilesZipID - Get specific zip file record
- GetServerlessZipFilesZipIDPackages - Returns a list of packages for a specific serverless zip
- GetServerlessZipFilesZipIDVulnerabilities - Returns a list of vulnerabilities detected in the serverless zip
- PostCloudAccountsScan - invoke cloud account scan
- PutCloudAccountsCloudAccountID - Edit cloud account definition
ConnectionPolicies
- GetConnectionsPolicy - Get current connection policy
- GetConnectionsPolicyHistory - Get the history of the connection policies
- GetConnectionsPolicyKafkaActions - Get the a list of kafka actions
- GetConnectionsPolicyKafkaKubernetesClusterIDBrokers - Get the a list of kafka brokers
- GetConnectionsPolicyKafkaKubernetesClusterIDTopics - Get the a list of kafka topics
- GetConnectionsPolicySearchOptions - Get the current connection policy filter option
- GetServerlessPolicyHistory - Get the history of the serverless policies
- PutConnectionsPolicy - Set the current connection policy
Dashboard
- GetDashboardApisecRiskFindings - Get API sec risk findings widget
- GetDashboardApisecRiskFindingsTrend - Get API sec risk findings trend graph widget for the last 30 days
- GetDashboardApisecSpecsAndOperationsDiffs - Get API sec specs and operations diffs widget
- GetDashboardApisecTopRiskyApis - Get API sec top risky APIs widget
- GetDashboardApisecTopRiskyFindings - Get API sec top risky findings widget
- GetDashboardClusters - Get the active clusters
- GetDashboardConnectionTelemetries - Get pod connection dashboard data for all clusters
- GetDashboardKubernetesAuditLogs - Get kubernetes audit logs dashboard data for all clusters
- GetDashboardOperationalBar - Get the operation data dashboard for the given kubernetesClusterId
- GetDashboardPermissions - Get permissions dashboard data for the given kubernetesClusterIds
- GetDashboardPodTelemetries - Get pod telemetries dashboard data for all clusters
- GetDashboardReportDownload - Download Secure Application security report
- GetDashboardReportStatus - Get Secure Application report security status
- GetDashboardSecurityContext - Get security context dashboard data for all clusters
- GetDashboardTopSecurityRisks - Get the top risky deployments dashboard data for the given kubernetesClusterIds
- GetDashboardVulnerabilities - Get vulnerabilities dashboard data for the given kubernetesClusterId
- GetDashboardKubernetesClusterIDConnectionTelemetries - Get connection telemetries dashboard data for the given kubernetesClusterId
- GetDashboardKubernetesClusterIDKubernetesAuditLogs - Get kubernetes audit logs dashboard data for the given kubernetesClusterId
- GetDashboardKubernetesClusterIDPodTelemetries - Get pod telemetries dashboard data for the given kubernetesClusterId
- GetLicensingDashboard - Get licensing dashboard data
- PostDashboardReportGenerate - Generate Secure Application security report
Deployers
- DeleteDeployersDeployerID - Delete an deployer
- GetDeployers - List all the deployers on the system
- GetDeployersServiceAccounts - List all the service account on the system
- GetDeployersDeployerIDDeleteDependencies - get dependencies which need to be handled in order to delete specified deployer
- PostDeployers - Create a new deployer
- PutDeployersDeployerID - Edit deployer definition
Envs
- DeleteEnvironmentsEnvID
- GetEnvironments - List all defined Secure Application environments
- GetEnvironmentsEnvID - get a Secure Application environment
- GetEnvironmentsEnvIDDeleteDependencies - get dependencies which need to be handled in order to delete specified environment
- PostEnvironments - Add a new environment
- PostEnvironmentsBatch - Add a number of Secure Application environments
- PostEnvironmentsDelete - Delete multiple Secure Application environments
- PutEnvironmentsEnvID - Edit an existing Secure Application environment
Expansions
- DeleteExpansionsExpansionID - Delete an expansion
- GetExpansions - List all the expansions on the system
- GetExpansionsExpansionIDInstallExpansionTarGz - Get the expansion installation
- PostExpansions - Create a new expansion
- PutExpansionsExpansionID - Edit expansion definition
Gateways
- DeleteGatewaysGatewayID - Delete gateway
- GetGateways - Get gateways
- GetGatewaysClusters - Get clusters info
- GetGatewaysGatewayIDDownloadBundle - Get a GW installation script
- PostGateways - Add new gateway
- PutGatewaysGatewayID - Edit gateway
Kubernetes
- DeleteKubernetesClustersKubernetesClusterID - Delete a Kubernetes cluster
- DeletePodDefinitionsPodID - Delete a pod definition
- GetGetControllerDataClusterID - get controller data using clusterId
- GetIstioSupportedVersions - Get a list of istio releases that are supported by Secure Application agent. sorted from latest to oldest
- GetKubernetesClusters - get a list of current Kubernetes clusters
- GetKubernetesClustersKubernetesClusterID - get the Kubernetes cluster with the given id
- GetKubernetesClustersKubernetesClusterIDDeleteDependencies - get dependencies which need to be handled in order to delete specified Kubernetes cluster
- GetKubernetesClustersKubernetesClusterIDDownloadBundle - Get Secure Application installation script
- GetKubernetesClustersKubernetesClusterIDGetHelmCommands - Get Panoptica Aug release Helm command
- GetKubernetesClustersKubernetesClusterIDNamespaces - List namespaces on a specific Kubernetes cluster
- GetKubernetesClustersKubernetesClusterIDServices - List services on a specific Kubernetes cluster
- GetLeanKubernetesClusters - get a list of current Kubernetes clusters
- GetNamespaces - Get a list of current Kubernetes namespaces
- GetPodDefinitions - Get all pod definitions on the system
- PostKubernetesClusters - Add a new Kubernetes cluster to Secure Application
- PostPodDefinitions - Create a new pod definition
- PutKubernetesClustersKubernetesClusterID - Update the Kubernetes cluster
- PutKubernetesClustersKubernetesClusterIDManagedByHelm - Update the Kubernetes cluster which managed by HELM
- PutPodDefinitionsPodID - Change pod definition
K8sCisBenchmark
- GetK8sCISBenchmark - Get k8s cis benchmark for clusters
- GetK8sCISBenchmarkSummary - Get k8s cis benchmark summary of account
- GetK8sCISBenchmarkClusterID - Get k8s cis benchmark for a specific cluster
- PostK8sCISBenchmarkClusterID - initiate k8s cis benchmark scan for a specific cluster
- PutK8sCISBenchmarkClusterID - edit k8s cis benchmark for a specific cluster with test statuses
ClusterEventsPolicies
- GetKubernetesAPIPolicy - Get current Kubernetes API policy
- GetKubernetesAPIPolicyHistory - Get the history of the Kubernetes API policies
- GetKubernetesAPIPolicyKubernetesResources - Get the Kubernetes resource list
- GetKubernetesAPIPolicyKubernetesUsers - Get the Kubernetes user list
- GetKubernetesAPIPolicyRecommendedRules - Get the recommended Kubernetes API rules
- PutKubernetesAPIPolicy - set the current Kubernetes API policy
Mitre
- GetMitreDashboard - Get data for MITRE dashboard for all clusters
- GetMitreReportDownload - Download Mitre security report
- GetMitreReportStatus - Get Mitre report status
- GetMitreTechnique - Get data for MITRE technique of the given mitreTechniqueType
- PostMitreReportGenerate - Generate Mitre report
- PostMitreTechniqueFix - Post fix for MITRE technique of the given mitreTechniqueType
RuntimeMap
- DeleteNetworkMapQueueRequestID - Cancel the network map background job
- GetNetworkMap - Get data for network map
- GetNetworkMapQueueRequestID - Get status for network map background job
- GetNetworkMapResultsRequestID - Get result for network map background job
PspProfiles
- DeletePodSecurityPolicyProfilesProfileID - Delete a pod security policy standards
- DeleteSeccompProfilesProfileID - Delete a seccomp profile
- GetPodSecurityPolicyProfiles - Get all the pod security standards profiles on the system
- GetSeccompProfiles - Get all the seccomp profiles on the system
- PostPodSecurityPolicyProfiles - Create a new pod security standards
- PostPodSecurityPolicyProfilesBatch - Add a number of Pod Security Standards
- PostSeccompProfiles - Add seccomp profile
- PutPodSecurityPolicyProfilesProfileID - Change pod security standards profile
- PutSeccompProfilesProfileID - Change seccomp profile
Registries
- DeleteRegistriesRegistryID - Delete a registry
- GetRegistries - Get a list of defined registries
- PostRegistries - Add new registry
- PostRegistriesTestConnection - test registry connection
- PostRegistriesTestConnectionRegistryID - test registry connection
- PutRegistriesRegistryID - edit existing registry
RiskAssessment
- DeleteRiskAssessmentIgnoredRisksIgnoredRiskID - Delete ignored risk
- DeleteRiskAssessmentKubernetesClusterIDCancel - Cancel the runtime scan on the given cluster with the given id
- GetRiskAssessment - Get risk assessment data for all clusters
- GetRiskAssessmentIgnoredRisks - Get all the ignored risks
- GetRiskAssessmentPermissions - Get list of clusters and their permissions
- GetRiskAssessmentPermissionsClusterID - Get all of the users permissions
- GetRiskAssessmentPermissionsClusterIDOwnerID - Get the owner permissions
- GetRiskAssessmentPermissionsClusterIDOwnerIDRoleID - Get the owner permissions
- GetRiskAssessmentPoll - Poll running scans
- GetRiskAssessmentImageIDVulnerabilities - Get all images of given risk assessment pod
- GetRiskAssessmentKubernetesClusterIDPods - Get all risk assessments of all pods of given cluster
- PostRiskAssessmentIgnoredRisks - Add ignore risk
- PostRiskAssessmentPermissionsOwnerIDApprove - add / remove permissions to /from the approved permissions list
- PostRiskAssessmentKubernetesClusterIDScan - Execute a new runtime scan on the given cluster with the given configuration
- PostRiskAssessmentKubernetesClusterIDSettings - Save the runtime scan configuration on the given cluster
- PutRiskAssessmentIgnoredRisksIgnoredRiskID - Edit ignore risk
Settings
- DeleteSettingsIntegrationsCaID - Delete the CA integration details
- DeleteSettingsIntegrationsEventForwardingEventForwardingID - Delete the event forwarding integration details with the given id
- GetSettingsAgentsUpdate - Get the agents update configurations
- GetSettingsIntegrationsCa - Get the CA integration details
- GetSettingsIntegrationsEventForwarding - Get the event forwarding integration details
- PostSeccompProfilesValidateData - Test the seccomp profile data
- PostSettingsAgentsUpdateUpdateNow - Update the agents of the account now
- PostSettingsIntegrationsCa - Set the CA integration details
- PostSettingsIntegrationsEventForwarding - Set the event forwarding integration details
- PostSettingsIntegrationsOpsgenieTestIntegration - Test the connection to Opsgenie
- PostSettingsIntegrationsSecurexTestIntegration - Test the SecureX integration by sending test message to the provided URL
- PostSettingsIntegrationsSlackTestIntegration - Test the Slack integration by sending test message to the provided URL
- PostSettingsIntegrationsSplunkTestIntegration - Test the connection to Splunk
- PostSettingsIntegrationsSumoLogicTestIntegration - Test the Sumo Logic integration by sending test message to the provided URL
- PostSettingsIntegrationsTeamsTestIntegration - Test the connection to Teams
- PostSettingsIntegrationsWebexTestIntegration - Test the Webex integration by sending test message to the provided URL
- PutSettingsAgentsUpdate - get the agents update configurations.
- PutSettingsIntegrationsCaID - Edit the CA integration details
- PutSettingsIntegrationsEventForwardingEventForwardingID - Edit the event forwarding integration details
ServerlessPolicies
- GetServerlessPolicy - Get current serverless policy
- PutServerlessPolicy - Set the current serverless policy
Tokens
- DeleteTokensTokenID - Delete token
- GetTokens - Get tokens
- GetTokensInfo - Get tokens by Ids
- GetTokensTokenIDDeleteDependencies - get dependancies which need to be handled in order to delete specified token
- PostTokens - Add new token
- PutTokensTokenID - Edit token
Cli
- GetToolsCliSecurecnDeploymentCli - Get the Secure Application deployment cli
Truncation
- GetTruncationImages - Get workloads truncation time for account
- GetTruncationWorkloads - Get workloads truncation time for account
- PostTruncationImages - Update workloads truncation status for account
- PostTruncationWorkloads - Update workloads truncation status for account
TrustedSigners
- DeleteTrustedSignersTrustedSignerID - Delete a trusted signer
- GetTrustedSigners - Get a list of defined trusted signers
- GetTrustedSignersTrustedSignerID - get existing trusted signer
- PostTrustedSigners - Add new trusted signer
- PutTrustedSignersTrustedSignerID - edit existing trusted signer
Vulnerabilities
- GetVulnerabilities - search for vulnerability names in the account
Special Types
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.APIResponse | 402 | application/json |
sdkerrors.SDKError | 4xx-5xx | / |
Example
package main
import (
"context"
"errors"
testpango "github.com/speakeasy-sdks/testpan-go"
"github.com/speakeasy-sdks/testpan-go/pkg/models/operations"
"github.com/speakeasy-sdks/testpan-go/pkg/models/sdkerrors"
"github.com/speakeasy-sdks/testpan-go/pkg/models/shared"
"log"
)
func main() {
s := testpango.New(
testpango.WithSecurity(shared.Security{
Password: testpango.String("<YOUR_PASSWORD_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Users.PostLogin(ctx, operations.PostLoginRequest{})
if err != nil {
var e *sdkerrors.APIResponse
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
var e *sdkerrors.SDKError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
}
}
Server Selection
Select Server by Index
You can override the default server globally using the WithServerIndex
option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
# | Server | Variables |
---|---|---|
0 | https:///api | None |
Example
package main
import (
"context"
testpango "github.com/speakeasy-sdks/testpan-go"
"github.com/speakeasy-sdks/testpan-go/pkg/models/operations"
"github.com/speakeasy-sdks/testpan-go/pkg/models/shared"
"log"
)
func main() {
s := testpango.New(
testpango.WithServerIndex(0),
testpango.WithSecurity(shared.Security{
Password: testpango.String("<YOUR_PASSWORD_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Users.DeleteUsersUserID(ctx, operations.DeleteUsersUserIDRequest{
UserID: "2d4aef6d-76db-4c57-a2a3-fe8efd3db6e2",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Override Server URL Per-Client
The default server can also be overridden globally using the WithServerURL
option when initializing the SDK client instance. For example:
package main
import (
"context"
testpango "github.com/speakeasy-sdks/testpan-go"
"github.com/speakeasy-sdks/testpan-go/pkg/models/operations"
"github.com/speakeasy-sdks/testpan-go/pkg/models/shared"
"log"
)
func main() {
s := testpango.New(
testpango.WithServerURL("https:///api"),
testpango.WithSecurity(shared.Security{
Password: testpango.String("<YOUR_PASSWORD_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Users.DeleteUsersUserID(ctx, operations.DeleteUsersUserIDRequest{
UserID: "2d4aef6d-76db-4c57-a2a3-fe8efd3db6e2",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Custom HTTP Client
The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}
The built-in net/http
client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.
import (
"net/http"
"time"
"github.com/myorg/your-go-sdk"
)
var (
httpClient = &http.Client{Timeout: 30 * time.Second}
sdkClient = sdk.New(sdk.WithClient(httpClient))
)
This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.
Authentication
Per-Client Security Schemes
This SDK supports the following security schemes globally:
Name | Type | Scheme |
---|---|---|
Password | http | HTTP Basic |
Username | http | HTTP Basic |
You can set the security parameters through the WithSecurity
option when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
package main
import (
"context"
testpango "github.com/speakeasy-sdks/testpan-go"
"github.com/speakeasy-sdks/testpan-go/pkg/models/operations"
"github.com/speakeasy-sdks/testpan-go/pkg/models/shared"
"log"
)
func main() {
s := testpango.New(
testpango.WithSecurity(shared.Security{
Password: testpango.String("<YOUR_PASSWORD_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Users.DeleteUsersUserID(ctx, operations.DeleteUsersUserIDRequest{
UserID: "2d4aef6d-76db-4c57-a2a3-fe8efd3db6e2",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!