Skip to content

Latest commit

 

History

History
148 lines (93 loc) · 3.82 KB

NamespacesApi.md

File metadata and controls

148 lines (93 loc) · 3.82 KB

\NamespacesApi

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.

NamespacesList

[]Namespace NamespacesList(ctx).Page(page).PageSize(pageSize).Execute()

Get a list of all namespaces the user belongs to.

Example

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)
}

Path Parameters

Other Parameters

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.

Return type

[]Namespace

Authorization

apikey, basic

HTTP request headers

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

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

NamespacesRead

Namespace NamespacesRead(ctx, slug).Execute()

Get a specific namespace that the user belongs to.

Example

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)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Namespace

Authorization

apikey, basic

HTTP request headers

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

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