All URIs are relative to https://api.cloudsmith.io/v1
Method | HTTP request | Description |
---|---|---|
NamespacesList | Get /namespaces/ | Get a list of all namespaces the user belongs to. |
NamespacesRead | Get /namespaces/{slug}/ | Get a specific namespace that the user belongs to. |
[]Namespace NamespacesList(ctx).Page(page).PageSize(pageSize).Execute()
Get a list of all namespaces the user belongs to.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/cloudsmith-io/cloudsmith-api-go"
)
func main() {
page := int64(56) // int64 | A page number within the paginated result set. (optional)
pageSize := int64(56) // int64 | Number of results to return per page. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NamespacesApi.NamespacesList(context.Background()).Page(page).PageSize(pageSize).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.NamespacesList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `NamespacesList`: []Namespace
fmt.Fprintf(os.Stdout, "Response from `NamespacesApi.NamespacesList`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiNamespacesListRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
page | int64 | A page number within the paginated result set. | |
pageSize | int64 | Number of results to return per page. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Namespace NamespacesRead(ctx, slug).Execute()
Get a specific namespace that the user belongs to.
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/cloudsmith-io/cloudsmith-api-go"
)
func main() {
slug := "slug_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NamespacesApi.NamespacesRead(context.Background(), slug).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NamespacesApi.NamespacesRead``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `NamespacesRead`: Namespace
fmt.Fprintf(os.Stdout, "Response from `NamespacesApi.NamespacesRead`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
slug | string |
Other parameters are passed through a pointer to a apiNamespacesReadRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]