Skip to content

Latest commit

 

History

History
347 lines (220 loc) · 8.11 KB

UsersAPI.md

File metadata and controls

347 lines (220 loc) · 8.11 KB

\UsersAPI

All URIs are relative to http://localhost

Method HTTP request Description
Add Post /api/v2/users
Delete1 Delete /api/v2/users/{username}
Get1 Get /api/v2/users/{username}
GetAll2 Get /api/v2/users
Update Put /api/v2/users/{username}

Add

Add(ctx).ApiUserDTO(apiUserDTO).Execute()

Example

package main

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

func main() {
	apiUserDTO := *sonatypeiq.NewApiUserDTO() // ApiUserDTO |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
apiUserDTO ApiUserDTO

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

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

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

Delete1

Delete1(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 | 
	realm := "realm_example" // string |  (optional) (default to "Internal")

	configuration := sonatypeiq.NewConfiguration()
	apiClient := sonatypeiq.NewAPIClient(configuration)
	r, err := apiClient.UsersAPI.Delete1(context.Background(), username).Realm(realm).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.Delete1``: %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.
username string

Other Parameters

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

Name Type Description Notes

realm | string | | [default to "Internal"]

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]

Get1

ApiUserDTO Get1(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 | 
	realm := "realm_example" // string |  (optional) (default to "Internal")

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

realm | string | | [default to "Internal"]

Return type

ApiUserDTO

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]

GetAll2

ApiUserListDTO GetAll2(ctx).Realm(realm).Execute()

Example

package main

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

func main() {
	realm := "realm_example" // string |  (optional) (default to "Internal")

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

Path Parameters

Other Parameters

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

Name Type Description Notes
realm string [default to "Internal"]

Return type

ApiUserListDTO

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]

Update

ApiUserDTO Update(ctx, username).ApiUserDTO(apiUserDTO).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 | 
	apiUserDTO := *sonatypeiq.NewApiUserDTO() // ApiUserDTO |  (optional)

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

apiUserDTO | ApiUserDTO | |

Return type

ApiUserDTO

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]