All URIs are relative to https://api.cloudsmith.io/v1
Method | HTTP request | Description |
---|---|---|
UserSelf | Get /user/self/ | Provide a brief for the current user (if any). |
UserTokenCreate | Post /user/token/ | Retrieve/Create API key/token for the authenticated user. |
UserBrief UserSelf(ctx).Execute()
Provide a brief for the current user (if any).
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/cloudsmith-io/cloudsmith-api-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.UserSelf(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UserSelf``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UserSelf`: UserBrief
fmt.Fprintf(os.Stdout, "Response from `UserApi.UserSelf`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiUserSelfRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserAuthToken UserTokenCreate(ctx).Data(data).Execute()
Retrieve/Create API key/token for the authenticated user.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/cloudsmith-io/cloudsmith-api-go"
)
func main() {
data := *openapiclient.NewUserAuthTokenRequest() // UserAuthTokenRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.UserTokenCreate(context.Background()).Data(data).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UserTokenCreate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UserTokenCreate`: UserAuthToken
fmt.Fprintf(os.Stdout, "Response from `UserApi.UserTokenCreate`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiUserTokenCreateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
data | UserAuthTokenRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]