Skip to content

Latest commit

 

History

History
527 lines (323 loc) · 13.9 KB

File metadata and controls

527 lines (323 loc) · 13.9 KB

\UserTokensAPI

All URIs are relative to http://localhost

Method HTTP request Description
CreateUserToken Post /api/v2/userTokens/currentUser
DeleteCurrentUserToken Delete /api/v2/userTokens/currentUser
DeleteUserTokenByUserCode Delete /api/v2/userTokens/userCode/{userCode}
GetCurrentUserTokenCreateTime Get /api/v2/userTokens/currentUser/createTime
GetUserTokenByUsernameAndRealmId Get /api/v2/userTokens/{username}
GetUserTokenExistsForCurrentUser Get /api/v2/userTokens/currentUser/hasToken
GetUserTokensByCreatedBetweenAndRealmId Get /api/v2/userTokens
PurgeUserTokens Delete /api/v2/userTokens/purge

CreateUserToken

ApiUserTokenDTO CreateUserToken(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.UserTokensAPI.CreateUserToken(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.CreateUserToken``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateUserToken`: ApiUserTokenDTO
	fmt.Fprintf(os.Stdout, "Response from `UserTokensAPI.CreateUserToken`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ApiUserTokenDTO

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]

DeleteCurrentUserToken

DeleteCurrentUserToken(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)
	r, err := apiClient.UserTokensAPI.DeleteCurrentUserToken(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.DeleteCurrentUserToken``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

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]

DeleteUserTokenByUserCode

DeleteUserTokenByUserCode(ctx, userCode).Execute()

Example

package main

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

func main() {
	userCode := "userCode_example" // string | Enter the `userCode` to be deleted.

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	r, err := apiClient.UserTokensAPI.DeleteUserTokenByUserCode(context.Background(), userCode).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.DeleteUserTokenByUserCode``: %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.
userCode string Enter the `userCode` to be deleted.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteUserTokenByUserCodeRequest 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]

GetCurrentUserTokenCreateTime

string GetCurrentUserTokenCreateTime(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.UserTokensAPI.GetCurrentUserTokenCreateTime(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.GetCurrentUserTokenCreateTime``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetCurrentUserTokenCreateTime`: string
	fmt.Fprintf(os.Stdout, "Response from `UserTokensAPI.GetCurrentUserTokenCreateTime`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

string

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]

GetUserTokenByUsernameAndRealmId

ApiUserTokenDTO GetUserTokenByUsernameAndRealmId(ctx, username).Realm(realm).Execute()

Example

package main

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

func main() {
	username := "username_example" // string | Enter the username.
	realm := "realm_example" // string | Enter the realmId. Possible values are `Internal`, `SAML` , `OAUTH2` , and `Crowd`. (optional) (default to "Internal")

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

realm | string | Enter the realmId. Possible values are `Internal`, `SAML` , `OAUTH2` , and `Crowd`. | [default to "Internal"]

Return type

ApiUserTokenDTO

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]

GetUserTokenExistsForCurrentUser

ApiUserTokenExistsDTO GetUserTokenExistsForCurrentUser(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.UserTokensAPI.GetUserTokenExistsForCurrentUser(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.GetUserTokenExistsForCurrentUser``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetUserTokenExistsForCurrentUser`: ApiUserTokenExistsDTO
	fmt.Fprintf(os.Stdout, "Response from `UserTokensAPI.GetUserTokenExistsForCurrentUser`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ApiUserTokenExistsDTO

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]

GetUserTokensByCreatedBetweenAndRealmId

[]ApiUserTokenDTO GetUserTokensByCreatedBetweenAndRealmId(ctx).CreatedAfter(createdAfter).CreatedBefore(createdBefore).Realm(realm).Execute()

Example

package main

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

func main() {
	createdAfter := "createdAfter_example" // string | Enter the start date for the date range in `yyyy-mm-dd` format. (optional)
	createdBefore := "createdBefore_example" // string | Enter the end date for the date range in `yyyy-mm-dd` format. (optional)
	realm := "realm_example" // string | Enter the `realmId`. Possible values are `Internal`, `SAML` , `OAUTH2`, and `Crowd`. (optional) (default to "Internal")

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	resp, r, err := apiClient.UserTokensAPI.GetUserTokensByCreatedBetweenAndRealmId(context.Background()).CreatedAfter(createdAfter).CreatedBefore(createdBefore).Realm(realm).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.GetUserTokensByCreatedBetweenAndRealmId``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetUserTokensByCreatedBetweenAndRealmId`: []ApiUserTokenDTO
	fmt.Fprintf(os.Stdout, "Response from `UserTokensAPI.GetUserTokensByCreatedBetweenAndRealmId`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
createdAfter string Enter the start date for the date range in `yyyy-mm-dd` format.
createdBefore string Enter the end date for the date range in `yyyy-mm-dd` format.
realm string Enter the `realmId`. Possible values are `Internal`, `SAML` , `OAUTH2`, and `Crowd`. [default to "Internal"]

Return type

[]ApiUserTokenDTO

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]

PurgeUserTokens

PurgeUserTokens(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)
	r, err := apiClient.UserTokensAPI.PurgeUserTokens(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserTokensAPI.PurgeUserTokens``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

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]