Skip to content

Latest commit

 

History

History
450 lines (288 loc) · 11.5 KB

LabelsAPI.md

File metadata and controls

450 lines (288 loc) · 11.5 KB

\LabelsAPI

All URIs are relative to http://localhost

Method HTTP request Description
AddLabel Post /api/v2/labels/{ownerType}/{ownerId}
DeleteLabel Delete /api/v2/labels/{ownerType}/{ownerId}/{labelId}
GetApplicableContexts Get /api/v2/labels/{ownerType}/{ownerId}/applicable/context/{labelId}
GetApplicableLabels Get /api/v2/labels/{ownerType}/{ownerId}/applicable
GetLabels Get /api/v2/labels/{ownerType}/{ownerId}
UpdateLabel Put /api/v2/labels/{ownerType}/{ownerId}

AddLabel

ApiLabelDTO AddLabel(ctx, ownerType, ownerId).ApiLabelDTO(apiLabelDTO).Execute()

Example

package main

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

func main() {
	ownerType := "ownerType_example" // string | 
	ownerId := "ownerId_example" // string | 
	apiLabelDTO := *sonatypeiq.NewApiLabelDTO() // ApiLabelDTO |  (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ownerType string
ownerId string

Other Parameters

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

Name Type Description Notes

apiLabelDTO | ApiLabelDTO | |

Return type

ApiLabelDTO

Authorization

BasicAuth

HTTP request headers

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

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

DeleteLabel

DeleteLabel(ctx, ownerType, ownerId, labelId).Execute()

Example

package main

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

func main() {
	ownerType := "ownerType_example" // string | 
	ownerId := "ownerId_example" // string | 
	labelId := "labelId_example" // string | 

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	r, err := apiClient.LabelsAPI.DeleteLabel(context.Background(), ownerType, ownerId, labelId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LabelsAPI.DeleteLabel``: %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.
ownerType string
ownerId string
labelId string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GetApplicableContexts

ApplicableContext GetApplicableContexts(ctx, ownerType, ownerId, labelId).Execute()

Example

package main

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

func main() {
	ownerType := "ownerType_example" // string | 
	ownerId := "ownerId_example" // string | 
	labelId := "labelId_example" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ownerType string
ownerId string
labelId string

Other Parameters

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

Name Type Description Notes

Return type

ApplicableContext

Authorization

BasicAuth

HTTP request headers

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

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

GetApplicableLabels

ApplicableLabels GetApplicableLabels(ctx, ownerType, ownerId).Execute()

Example

package main

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

func main() {
	ownerType := "ownerType_example" // string | 
	ownerId := "ownerId_example" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ownerType string
ownerId string

Other Parameters

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

Name Type Description Notes

Return type

ApplicableLabels

Authorization

BasicAuth

HTTP request headers

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

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

GetLabels

[]ApiLabelDTO GetLabels(ctx, ownerType, ownerId).Inherit(inherit).Execute()

Example

package main

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

func main() {
	ownerType := "ownerType_example" // string | 
	ownerId := "ownerId_example" // string | 
	inherit := true // bool |  (optional) (default to false)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ownerType string
ownerId string

Other Parameters

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

Name Type Description Notes

inherit | bool | | [default to false]

Return type

[]ApiLabelDTO

Authorization

BasicAuth

HTTP request headers

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

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

UpdateLabel

ApiLabelDTO UpdateLabel(ctx, ownerType, ownerId).ApiLabelDTO(apiLabelDTO).Execute()

Example

package main

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

func main() {
	ownerType := "ownerType_example" // string | 
	ownerId := "ownerId_example" // string | 
	apiLabelDTO := *sonatypeiq.NewApiLabelDTO() // ApiLabelDTO |  (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
ownerType string
ownerId string

Other Parameters

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

Name Type Description Notes

apiLabelDTO | ApiLabelDTO | |

Return type

ApiLabelDTO

Authorization

BasicAuth

HTTP request headers

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

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