Skip to content

Latest commit

 

History

History
277 lines (169 loc) · 10.3 KB

File metadata and controls

277 lines (169 loc) · 10.3 KB

\LicenseLegalMetadataTemplateAPI

All URIs are relative to http://localhost

Method HTTP request Description
DeleteAttributionReportTemplate Delete /api/v2/licenseLegalMetadata/report-template/{id}
GetAllAttributionReportTemplates Get /api/v2/licenseLegalMetadata/report-template
GetAttributionReportTemplateById Get /api/v2/licenseLegalMetadata/report-template/{id}
SaveAttributionReportTemplate Post /api/v2/licenseLegalMetadata/report-template

DeleteAttributionReportTemplate

DeleteAttributionReportTemplate(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatypeiq "github.com/sonatype-nexus-community/nexus-iq-api-client-go"
)

func main() {
	id := "id_example" // string | Enter the template id for the template to be deleted.

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	r, err := apiClient.LicenseLegalMetadataTemplateAPI.DeleteAttributionReportTemplate(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicenseLegalMetadataTemplateAPI.DeleteAttributionReportTemplate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Enter the template id for the template to be deleted.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteAttributionReportTemplateRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

BasicAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAllAttributionReportTemplates

[]AttributionReportTemplateDTO GetAllAttributionReportTemplates(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatypeiq "github.com/sonatype-nexus-community/nexus-iq-api-client-go"
)

func main() {

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.LicenseLegalMetadataTemplateAPI.GetAllAttributionReportTemplates(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicenseLegalMetadataTemplateAPI.GetAllAttributionReportTemplates``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAllAttributionReportTemplates`: []AttributionReportTemplateDTO
	fmt.Fprintf(os.Stdout, "Response from `LicenseLegalMetadataTemplateAPI.GetAllAttributionReportTemplates`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetAllAttributionReportTemplatesRequest struct via the builder pattern

Return type

[]AttributionReportTemplateDTO

Authorization

BasicAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAttributionReportTemplateById

AttributionReportTemplateDTO GetAttributionReportTemplateById(ctx, id).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatypeiq "github.com/sonatype-nexus-community/nexus-iq-api-client-go"
)

func main() {
	id := "id_example" // string | Enter the templateId for the report.

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.LicenseLegalMetadataTemplateAPI.GetAttributionReportTemplateById(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicenseLegalMetadataTemplateAPI.GetAttributionReportTemplateById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAttributionReportTemplateById`: AttributionReportTemplateDTO
	fmt.Fprintf(os.Stdout, "Response from `LicenseLegalMetadataTemplateAPI.GetAttributionReportTemplateById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Enter the templateId for the report.

Other Parameters

Other parameters are passed through a pointer to a apiGetAttributionReportTemplateByIdRequest struct via the builder pattern

Name Type Description Notes

Return type

AttributionReportTemplateDTO

Authorization

BasicAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SaveAttributionReportTemplate

AttributionReportTemplateDTO SaveAttributionReportTemplate(ctx).AttributionReportTemplateDTO(attributionReportTemplateDTO).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatypeiq "github.com/sonatype-nexus-community/nexus-iq-api-client-go"
)

func main() {
	attributionReportTemplateDTO := *sonatypeiq.NewAttributionReportTemplateDTO() // AttributionReportTemplateDTO | Specify the details for the template as:<ul><li>`id` is the template id.</li><li>`templateName` indicates the name of the stored template.</li><li>`documentTitle` is the title that is displayed at the top of the report.</li><li>`header` is the text that will be displayed above the `documentTitle`.</li><li>`footer` is the text that will be displayed at the bottom of the report.<li><li>`includeTableOfContents` is `true` if a table of contents containing links to the components and their licenses will be added to the report.<li>`includeAppendix` is `true` if standard license text will be grouped in the report appendix.</li><li>`includeStandardLicenseTexts` is `true` if the standard license text will be displayed for components with no license files.</li><li>`includeSonatypeSpecialLicenses` is `true` if Sonatype Special Licenses (e.g. Generic-Copyleft-Clause, Generic-Liberal-Clause, See-License-Clause, Identity-Clause etc.) will be included in the report.</li><li>`includeInnerSource` is `true` if InnerSource components will be included in the report.</li></ul> (optional)

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.LicenseLegalMetadataTemplateAPI.SaveAttributionReportTemplate(context.Background()).AttributionReportTemplateDTO(attributionReportTemplateDTO).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LicenseLegalMetadataTemplateAPI.SaveAttributionReportTemplate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `SaveAttributionReportTemplate`: AttributionReportTemplateDTO
	fmt.Fprintf(os.Stdout, "Response from `LicenseLegalMetadataTemplateAPI.SaveAttributionReportTemplate`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiSaveAttributionReportTemplateRequest struct via the builder pattern

Name Type Description Notes
attributionReportTemplateDTO AttributionReportTemplateDTO Specify the details for the template as:<ul><li>`id` is the template id.</li><li>`templateName` indicates the name of the stored template.</li><li>`documentTitle` is the title that is displayed at the top of the report.</li><li>`header` is the text that will be displayed above the `documentTitle`.</li><li>`footer` is the text that will be displayed at the bottom of the report.<li><li>`includeTableOfContents` is `true` if a table of contents containing links to the components and their licenses will be added to the report.<li>`includeAppendix` is `true` if standard license text will be grouped in the report appendix.</li><li>`includeStandardLicenseTexts` is `true` if the standard license text will be displayed for components with no license files.</li><li>`includeSonatypeSpecialLicenses` is `true` if Sonatype Special Licenses (e.g. Generic-Copyleft-Clause, Generic-Liberal-Clause, See-License-Clause, Identity-Clause etc.) will be included in the report.</li><li>`includeInnerSource` is `true` if InnerSource components will be included in the report.</li></ul>

Return type

AttributionReportTemplateDTO

Authorization

BasicAuth, BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]