### Quickstart example for ASM SDK Go Source: https://github.com/hexiosec/asm-sdk-go/blob/main/README.md Complete Go program that initializes the client with an API key and calls the GetReportsForOrg endpoint. ```go package main import ( "context" "fmt" "log" asm "github.com/hexiosec/asm-sdk-go" ) func main() { cfg := asm.NewConfiguration() cfg.APIKey = "YOUR_API_KEY" // X-Hexiosec-API-Key client := asm.NewAPIClient(cfg) // Example: call an endpoint (replace with a real one from docs) resp, _, err := client.ReportsAPI.GetReportsForOrg(context.Background(), "ORG_ID").Execute() if err != nil { log.Fatal(err) } fmt.Println(len(resp)) } ``` -------------------------------- ### Install ASM SDK Go with go get Source: https://github.com/hexiosec/asm-sdk-go/blob/main/README.md Install the ASM SDK for Go using the go get command. ```bash go get github.com/hexiosec/asm-sdk-go ``` -------------------------------- ### Get services by scan ID using ScanDataAPI.GetScanDataServices Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Calls the ScanDataAPI.GetScanDataServices endpoint to retrieve services by scan ID. The example sets all optional parameters (ids, limit, offset, order, dir, lang) and prints the response or error. Requires an API client configuration and a valid scan ID. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID ids := []string{"Inner_example"} // []string | List of service IDs to filter by (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataServices(context.Background(), scanId).Ids(ids).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataServices``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataServices`: []ScanDataServiceResponse fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataServices`: %v\n", resp) } ``` -------------------------------- ### Get a report with ReportsAPI.GetReport Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ReportsAPI.md Retrieves a report by its ID. The example sets up the API client and calls GetReport, printing the response or an error with the full HTTP response on failure. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Report ID configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ReportsAPI.GetReport(context.Background(), id).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetReport``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetReport`: ReportResponse fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetReport`: %v\n", resp) } ``` -------------------------------- ### GET /v1/definitions/definition Source: https://github.com/hexiosec/asm-sdk-go/blob/main/README.md Get Definition. ```APIDOC ## GET /v1/definitions/definition ### Description Get Definition. ### Method GET ### Endpoint /v1/definitions/definition ``` -------------------------------- ### GetRisksByActionID usage example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ActionsAPI.md Demonstrates how to initialize the API client and call GetRisksByActionID with optional parameters. The example includes error handling for the API request and prints the response. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { id := "id_example" // string | Action ID limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ActionsAPI.GetRisksByActionID(context.Background(), id).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ActionsAPI.GetRisksByActionID``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetRisksByActionID`: []ScanDataRiskResponse fmt.Fprintf(os.Stdout, "Response from `ActionsAPI.GetRisksByActionID`: %v\n", resp) } ``` -------------------------------- ### GetScanDataIPs Go example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Example of calling the GetScanDataIPs API using the asm-sdk-go client. It sets up the API client, calls the method with optional parameters, and prints the response or error. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID ids := []string{"Inner_example"} // []string | List of ip IDs to filter by (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataIPs(context.Background(), scanId).Ids(ids).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataIPs``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataIPs`: []ScanDataIPResponse fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataIPs`: %v\n", resp) } ``` -------------------------------- ### GetUserMarketingPreferences Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/UsersAPI.md Calls the GetUserMarketingPreferences endpoint to get marketing email preferences for the logged-in user. Requires APIKey authorization. The response is a MarketingPreferencesResponse. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.UsersAPI.GetUserMarketingPreferences(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.GetUserMarketingPreferences``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetUserMarketingPreferences`: MarketingPreferencesResponse fmt.Fprintf(os.Stdout, "Response from `UsersAPI.GetUserMarketingPreferences`: %v\n", resp) } ``` -------------------------------- ### GetScanDataOutOfScopeDomains Go example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Example of calling the GetScanDataOutOfScopeDomains API using the asm-sdk-go client. It sets up the API client, calls the method with scanId and optional parameters, and prints the response or error. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID ids := []string{"Inner_example"} // []string | List of out-of-scope domain IDs to filter by (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataOutOfScopeDomains(context.Background(), scanId).Ids(ids).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataOutOfScopeDomains``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataOutOfScopeDomains`: []ScanDataOutOfScopeDomainResponse fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataOutOfScopeDomains`: %v\n", resp) } ``` -------------------------------- ### GetActionByID Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ActionsAPI.md Example of calling the GetActionByID endpoint. It sets up the API client, passes the action ID and optional expand and lang parameters, and prints the response or error. The expand parameter accepts a list of fields, some of which are deprecated. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { id := "id_example" // string | Action ID expand := []string{"Expand_example"} // []string | Fields to expand with additional information: * `links` - Expand instances of the risks under this action. DEPRECATED * `link_ids` - Same as `links` except only the IDs are returned. DEPRECATED * `link_from` - Node where the risk was found. DEPRECATED * `link_to` - Node which represents the risk. DEPRECATED * `target` - Node which carries this action. DEPRECATED * `assignee_user` - User to whom this action is assigned * `modified_by` - User to last update this action * `note_modified_by` - User to last update the note against this action (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ActionsAPI.GetActionByID(context.Background(), id).Expand(expand).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ActionsAPI.GetActionByID``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetActionByID`: ActionResponse fmt.Fprintf(os.Stdout, "Response from `ActionsAPI.GetActionByID`: %v\n", resp) } ``` -------------------------------- ### GetReportsForOrg example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ReportsAPI.md Calls the ReportsAPI.GetReportsForOrg endpoint to retrieve reports for an organisation. The example sets up the API client and invokes the method with optional search, type, templateId, limit, offset, order, and dir parameters. It prints the response or error details to stdout/stderr. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { orgId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organisation ID search := "search_example" // string | Search term (optional) type_ := asm.ReportType("summary") // ReportType | Report type (optional) templateId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Template ID used to generate report (optional) limit := int32(56) // int32 | Maximum number of entries to return (optional) offset := int32(56) // int32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ReportsAPI.GetReportsForOrg(context.Background(), orgId).Search(search).Type_(type_).TemplateId(templateId).Limit(limit).Offset(offset).Order(order).Dir(dir).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetReportsForOrg``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetReportsForOrg`: []ReportResponse fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetReportsForOrg`: %v\n", resp) } ``` -------------------------------- ### GetReportTemplatesForOrg Go Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ReportsAPI.md Example Go code that calls the GetReportTemplatesForOrg API with an organisation ID and an optional includeGlobal flag. It prints the response or error to stdout/stderr. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { orgId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organisation ID includeGlobal := true // bool | Include global templates (`organisation_id = null`) in addition to organisation templates (optional) (default to false) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ReportsAPI.GetReportTemplatesForOrg(context.Background(), orgId).IncludeGlobal(includeGlobal).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetReportTemplatesForOrg``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetReportTemplatesForOrg`: []ReportTemplateResponse fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetReportTemplatesForOrg`: %v\n", resp) } ``` -------------------------------- ### GetActions API call example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ActionsAPI.md Example of calling the GetActions endpoint using the asm-sdk-go client. It sets up the API client, builds the request with optional parameters (scanId, scanGroupId, limit, offset, order, dir, expand, includeOutOfScope, includeSecondary, lang), and prints the response or error. The response is of type []ActionResponse. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID (optional) scanGroupId := "scanGroupId_example" // string | Scan Group ID (required if Scan ID is not provided) (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) expand := []string{"Expand_example"} // []string | Fields to expand with additional information: * `links` - Expand instances of the risks under this action. DEPRECATED * `link_ids` - Same as `links` except only the IDs are returned. DEPRECATED * `link_from` - Node where the risk was found (requires `links` to be expanded). DEPRECATED * `link_to` - Node which represents the risk (requires `links` to be expanded). DEPRECATED * `target` - Node which carries this action. DEPRECATED * `assignee_user` - User to whom this action is assigned * `modified_by` - User to last update this action * `note_modified_by` - User to last update the note against this action (optional) includeOutOfScope := true // bool | If set, return actions with out_of_scope set to false DEPRECATED - Use include_secondary (optional) includeSecondary := true // bool | If set, returns primary and secondary actions (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ActionsAPI.GetActions(context.Background()).ScanId(scanId).ScanGroupId(scanGroupId).Limit(limit).Offset(offset).Order(order).Dir(dir).Expand(expand).IncludeOutOfScope(includeOutOfScope).IncludeSecondary(includeSecondary).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ActionsAPI.GetActions``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetActions`: []ActionResponse fmt.Fprintf(os.Stdout, "Response from `ActionsAPI.GetActions`: %v\n", resp) } ``` -------------------------------- ### GetScanDataRisks Go Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Example of calling GetScanDataRisks with optional parameters. It uses the asm-sdk-go client, prints errors and the response. The response type is []ScanDataRiskResponse. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID linkIds := []string{"Inner_example"} // []string | List of risk Link IDs to filter by (optional) riskNodeIds := []string{"Inner_example"} // []string | List of risk Node IDs to filter by (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataRisks(context.Background(), scanId).LinkIds(linkIds).RiskNodeIds(riskNodeIds).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataRisks``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataRisks`: []ScanDataRiskResponse fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataRisks`: %v\n", resp) } ``` -------------------------------- ### GetReportsForScan Go example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ReportsAPI.md Calls the ReportsAPI.GetReportsForScan endpoint with a scan ID and optional parameters. The example prints the response or an error to stderr. It uses the asm-sdk-go client and requires a valid scan ID. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Scan ID search := "search_example" // string | Search term (optional) type_ := asm.ReportType("summary") // ReportType | Report type (optional) templateId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Template ID used to generate report (optional) limit := int32(56) // int32 | Maximum number of entries to return (optional) offset := int32(56) // int32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ReportsAPI.GetReportsForScan(context.Background(), scanId).Search(search).Type_(type_).TemplateId(templateId).Limit(limit).Offset(offset).Order(order).Dir(dir).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ReportsAPI.GetReportsForScan``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetReportsForScan`: []ReportResponse fmt.Fprintf(os.Stdout, "Response from `ReportsAPI.GetReportsForScan`: %v\n", resp) } ``` -------------------------------- ### Get primary web presence URLs with GetScanDataWebPresence Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Call the GetScanDataWebPresence endpoint to retrieve primary web presence URLs for a given scan ID. The example sets up the API client, passes optional filter parameters (ids, limit, offset, order, dir, lang), and prints the response or error. Requires a valid scanId and API key authorization. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID ids := []string{"Inner_example"} // []string | List of URL IDs to filter by (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataWebPresence(context.Background(), scanId).Ids(ids).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataWebPresence``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataWebPresence`: []ScanDataWebPresenceResponse fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataWebPresence`: %v\n", resp) } ``` -------------------------------- ### GetStarted Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanIterationMetricResponse.md Returns the Started field if non-nil, zero value otherwise. ```APIDOC ## GetStarted ### Description Returns the Started field if non-nil, zero value otherwise. ### Signature `func (o *ScanIterationMetricResponse) GetStarted() time.Time` ### Returns - **time.Time** - The Started field value. ``` -------------------------------- ### GetScreenshotById Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScansAPI.md Retrieves a web presence screenshot by ID. The response is an *os.File. The example prints the response and any error to stdout/stderr. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { id := "id_example" // string | Screenshot ID scanId := "scanId_example" // string | Scan ID configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScansAPI.GetScreenshotById(context.Background(), id, scanId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScansAPI.GetScreenshotById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScreenshotById`: *os.File fmt.Fprintf(os.Stdout, "Response from `ScansAPI.GetScreenshotById`: %v\n", resp) } ``` -------------------------------- ### GET /v1/orgs/{id}/asset/{key} Source: https://github.com/hexiosec/asm-sdk-go/blob/main/README.md Get an organisation asset by key. ```APIDOC ## GET /v1/orgs/{id}/asset/{key} ### Description Get an organisation asset by key. ### Method GET ### Endpoint /v1/orgs/{id}/asset/{key} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the organisation. - **key** (string) - Required - The key of the asset. ``` -------------------------------- ### CreateScanGroup example in Go Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanGroupsAPI.md Example of creating a new scan group using the CreateScanGroup endpoint. It constructs a ScanGroupCreateRequestBody with name and organisation ID, then calls the API and prints the response or error. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanGroupCreateRequestBody := *asm.NewScanGroupCreateRequestBody("Name_example", "OrganisationId_example") // ScanGroupCreateRequestBody | configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanGroupsAPI.CreateScanGroup(context.Background()).ScanGroupCreateRequestBody(scanGroupCreateRequestBody).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanGroupsAPI.CreateScanGroup``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateScanGroup`: ScanGroupResponse fmt.Fprintf(os.Stdout, "Response from `ScanGroupsAPI.CreateScanGroup`: %v\n", resp) } ``` -------------------------------- ### GetStartedMin / SetStartedMin / HasStartedMin Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/GetDashboardMetricsRequest.md Gets, sets, and checks the StartedMin field. ```APIDOC ## GetStartedMin / SetStartedMin / HasStartedMin ### Description Gets, sets, and checks the StartedMin field. ### Methods - `func (o *GetDashboardMetricsRequest) GetStartedMin() time.Time` - `func (o *GetDashboardMetricsRequest) GetStartedMinOk() (*time.Time, bool)` - `func (o *GetDashboardMetricsRequest) SetStartedMin(v time.Time)` - `func (o *GetDashboardMetricsRequest) HasStartedMin() bool` ### Parameters (SetStartedMin) - **v** (time.Time) - Required - The value to set. ### Returns (GetStartedMin) - **time.Time** - The StartedMin field if non-nil, zero value otherwise. ### Returns (GetStartedMinOk) - **\*time.Time** - The StartedMin field if non-nil, zero value otherwise. - **bool** - Boolean to check if the value has been set. ### Returns (HasStartedMin) - **bool** - Boolean indicating if the field has been set. ``` -------------------------------- ### UpdateUserPreferences Go Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/UsersAPI.md Updates preferences for the user logged in to the current session. The example creates an UpdateUserPreferencesRequest, calls the API, and prints the response or error. Requires an API key for authorization. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { updateUserPreferencesRequest := *asm.NewUpdateUserPreferencesRequest() // UpdateUserPreferencesRequest | configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.UsersAPI.UpdateUserPreferences(context.Background()).UpdateUserPreferencesRequest(updateUserPreferencesRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.UpdateUserPreferences``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `UpdateUserPreferences`: UserRowResponse fmt.Fprintf(os.Stdout, "Response from `UsersAPI.UpdateUserPreferences`: %v\n", resp) } ``` -------------------------------- ### SetStarted Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanIterationMetricResponse.md Sets the Started field to the given value. ```APIDOC ## SetStarted ### Description Sets the Started field to the given value. ### Signature `func (o *ScanIterationMetricResponse) SetStarted(v time.Time)` ### Parameters - **v** (time.Time) - The value to set for the Started field. ``` -------------------------------- ### Set API key and call an operation Source: https://github.com/hexiosec/asm-sdk-go/blob/main/README.md Configure the API client with an API key and make a sample API call. ```go cfg := asm.NewConfiguration() cfg.APIKey = "API_TOKEN_STRING" client := asm.NewAPIClient(cfg) r, err := client.Service.Operation(context.Background()) ``` -------------------------------- ### CountUserAPIKeys Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/UsersAPI.md Calls the CountUserAPIKeys endpoint to get the API key count for the logged-in user. Requires SessionCookie authorization. The response is an InlineObject. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.UsersAPI.CountUserAPIKeys(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.CountUserAPIKeys``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CountUserAPIKeys`: InlineObject fmt.Fprintf(os.Stdout, "Response from `UsersAPI.CountUserAPIKeys`: %v\n", resp) } ``` -------------------------------- ### GetTagsByOrganisationIDCount Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/TagsAPI.md Calls TagsAPI.GetTagsByOrganisationIDCount to get the tag count for an organisation. Requires an organisation ID and optional filters for name, creator, and updater. Prints the response or error to stdout/stderr. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { orgId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organisation ID name := "name_example" // string | Filter tags by name (optional) createdBy := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Filter tags by creator user ID (optional) updatedBy := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Filter tags by updater user ID (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.TagsAPI.GetTagsByOrganisationIDCount(context.Background(), orgId).Name(name).CreatedBy(createdBy).UpdatedBy(updatedBy).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.GetTagsByOrganisationIDCount``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetTagsByOrganisationIDCount`: InlineObject fmt.Fprintf(os.Stdout, "Response from `TagsAPI.GetTagsByOrganisationIDCount`: %v\n", resp) } ``` -------------------------------- ### GetSupplierScansForOrgCount Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScansAPI.md Calls the ScansAPI.GetSupplierScansForOrgCount endpoint to get the count of supplier scans for a specified organisation. The example sets up the API client and passes optional filters like type_, tags, search, searchSeeds, includeDisabled, and includeDeleted. On error, it prints the error and full HTTP response to stderr; on success, it prints the response to stdout. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { organisationId := "organisationId_example" // string | Organisation ID type_ := []string{"Type_example"} // []string | Filter by scan types (optional) tags := []string{"Inner_example"} // []string | Filter scans by tag names (optional) search := "search_example" // string | Search scans by scan name or seed name (optional) searchSeeds := true // bool | Include seed names in the search filter (optional) includeDisabled := true // bool | Include disabled scans (optional) includeDeleted := true // bool | Include deleted scans (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScansAPI.GetSupplierScansForOrgCount(context.Background()).OrganisationId(organisationId).Type_(type_).Tags(tags).Search(search).SearchSeeds(searchSeeds).IncludeDisabled(includeDisabled).IncludeDeleted(includeDeleted).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScansAPI.GetSupplierScansForOrgCount``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetSupplierScansForOrgCount`: InlineObject fmt.Fprintf(os.Stdout, "Response from `ScansAPI.GetSupplierScansForOrgCount`: %v\n", resp) } ``` -------------------------------- ### AddTagToScan Go Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/TagsAPI.md Adds a tag to a scan using the TagsAPI.AddTagToScan method. The example creates an AddTagToScanRequest with a tag name and executes the request, printing the response or error. Requires a valid scanId and APIKey authorization. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Scan ID addTagToScanRequest := *asm.NewAddTagToScanRequest("TagName_example") // AddTagToScanRequest | configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.TagsAPI.AddTagToScan(context.Background(), scanId).AddTagToScanRequest(addTagToScanRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.AddTagToScan``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `AddTagToScan`: ScanTagResponse fmt.Fprintf(os.Stdout, "Response from `TagsAPI.AddTagToScan`: %v\n", resp) } ``` -------------------------------- ### Get a scan group by ID using GetScanGroupByID Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanGroupsAPI.md Retrieves a scan group by its ID, optionally expanding fields. The example calls GetScanGroupByID with the ID and an expand list, prints any error to stderr, and prints the response to stdout. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { id := "id_example" // string | Scan Group ID expand := []string{"Expand_example"} // []string | Fields to expand with additional information (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanGroupsAPI.GetScanGroupByID(context.Background(), id).Expand(expand).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanGroupsAPI.GetScanGroupByID``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanGroupByID`: ScanGroupResponse fmt.Fprintf(os.Stdout, "Response from `ScanGroupsAPI.GetScanGroupByID`: %v\n", resp) } ``` -------------------------------- ### GetStartedMax / SetStartedMax / HasStartedMax Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/GetDashboardMetricsRequest.md Gets, sets, and checks the StartedMax field. ```APIDOC ## GetStartedMax / SetStartedMax / HasStartedMax ### Description Gets, sets, and checks the StartedMax field. ### Methods - `func (o *GetDashboardMetricsRequest) GetStartedMax() time.Time` - `func (o *GetDashboardMetricsRequest) GetStartedMaxOk() (*time.Time, bool)` - `func (o *GetDashboardMetricsRequest) SetStartedMax(v time.Time)` - `func (o *GetDashboardMetricsRequest) HasStartedMax() bool` ### Parameters (SetStartedMax) - **v** (time.Time) - Required - The value to set. ### Returns (GetStartedMax) - **time.Time** - The StartedMax field if non-nil, zero value otherwise. ### Returns (GetStartedMaxOk) - **\*time.Time** - The StartedMax field if non-nil, zero value otherwise. - **bool** - Boolean to check if the value has been set. ### Returns (HasStartedMax) - **bool** - Boolean indicating if the field has been set. ``` -------------------------------- ### GetScanDataRisksCount API call in Go Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Example of calling the GetScanDataRisksCount API to get the count of risks by scan ID. It uses the asm-sdk-go client, sets up the configuration and API client, and executes the request with optional linkIds and riskNodeIds filters. The response is an InlineObject. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID linkIds := []string{"Inner_example"} // []string | List of risk Link IDs to filter by (optional) riskNodeIds := []string{"Inner_example"} // []string | List of risk Node IDs to filter by (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataRisksCount(context.Background(), scanId).LinkIds(linkIds).RiskNodeIds(riskNodeIds).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataRisksCount``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataRisksCount`: InlineObject fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataRisksCount`: %v\n", resp) } ``` -------------------------------- ### GetDefinition API call in Go Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/DefinitionsAPI.md Example of calling the GetDefinition endpoint with lang, key, and subkey parameters. It creates a configuration and API client, then executes the request and prints the response or error. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { lang := "lang_example" // string | Language code (e.g. en_gb) key := "key_example" // string | Definition key (e.g. urn:issue:mail:policy:missing) subkey := "subkey_example" // string | Definition subkey (e.g. description) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.DefinitionsAPI.GetDefinition(context.Background()).Lang(lang).Key(key).Subkey(subkey).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefinitionsAPI.GetDefinition``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetDefinition`: GetDefinition200Response fmt.Fprintf(os.Stdout, "Response from `DefinitionsAPI.GetDefinition`: %v\n", resp) } ``` -------------------------------- ### AddTagToNode Go Example Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/TagsAPI.md Adds a tag to a node using the TagsAPI.AddTagToNode method. The example creates an AddTagToNodeRequest with a tag ID and calls the API with a node ID. Requires an API key for authorization and uses application/json for both request and response. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { nodeId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Node ID addTagToNodeRequest := *asm.NewAddTagToNodeRequest("TagId_example") // AddTagToNodeRequest | configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.TagsAPI.AddTagToNode(context.Background(), nodeId).AddTagToNodeRequest(addTagToNodeRequest).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.AddTagToNode``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `AddTagToNode`: NodeTagResponse fmt.Fprintf(os.Stdout, "Response from `TagsAPI.AddTagToNode`: %v\n", resp) } ``` -------------------------------- ### Get primary domains by scan ID using ScanDataAPI.GetScanDataDomains Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanDataAPI.md Call the GetScanDataDomains endpoint to retrieve primary domains by scan ID. The example sets up the API client, passes optional filter parameters (ids, limit, offset, order, dir, lang), and prints the response or error. Requires an API key for authorization. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { scanId := "scanId_example" // string | Scan ID ids := []string{"Inner_example"} // []string | List of domain IDs to filter by (optional) limit := float32(8.14) // float32 | Maximum number of entries to return (optional) offset := float32(8.14) // float32 | Offset into the list of entries to return (optional) order := "order_example" // string | Column to order results by (optional) dir := "dir_example" // string | Sort direction (optional) lang := "lang_example" // string | Language of text (optional) configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.ScanDataAPI.GetScanDataDomains(context.Background(), scanId).Ids(ids).Limit(limit).Offset(offset).Order(order).Dir(dir).Lang(lang).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ScanDataAPI.GetScanDataDomains``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetScanDataDomains`: []ScanDataDomainResponse fmt.Fprintf(os.Stdout, "Response from `ScanDataAPI.GetScanDataDomains`: %v\n", resp) } ``` -------------------------------- ### GetStartedOk Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/ScanIterationMetricResponse.md Returns a tuple with the Started field if it's non-nil, zero value otherwise, and a boolean to check if the value has been set. ```APIDOC ## GetStartedOk ### Description Returns a tuple with the Started field if it's non-nil, zero value otherwise, and a boolean to check if the value has been set. ### Signature `func (o *ScanIterationMetricResponse) GetStartedOk() (*time.Time, bool)` ### Returns - **\*time.Time** - The Started field value if set, otherwise zero value. - **bool** - True if the Started field has been set, false otherwise. ``` -------------------------------- ### GetState API call in Go Source: https://github.com/hexiosec/asm-sdk-go/blob/main/docs/AuthAPI.md Example of calling the GetState endpoint using the Go SDK. It creates a configuration and API client, then executes the request and prints the response or error. ```go package main import ( "context" "fmt" "os" asm "github.com/hexiosec/asm-sdk-go" ) func main() { configuration := asm.NewConfiguration() apiClient := asm.NewAPIClient(configuration) resp, r, err := apiClient.AuthAPI.GetState(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.GetState``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetState`: AuthResponse fmt.Fprintf(os.Stdout, "Response from `AuthAPI.GetState`: %v\n", resp) } ``` -------------------------------- ### GET /v1/users Source: https://github.com/hexiosec/asm-sdk-go/blob/main/README.md Get the users in an organisation. ```APIDOC ## GET /v1/users ### Description Get the users in an organisation. ### Method GET ### Endpoint /v1/users ```