All URIs are relative to https://api.cloudsmith.io/v1
Method | HTTP request | Description |
---|---|---|
FormatsList | Get /formats/ | Get a list of all supported package formats. |
FormatsRead | Get /formats/{slug}/ | Get a specific supported package format. |
[]Format FormatsList(ctx).Execute()
Get a list of all supported package formats.
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.FormatsApi.FormatsList(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FormatsApi.FormatsList``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FormatsList`: []Format
fmt.Fprintf(os.Stdout, "Response from `FormatsApi.FormatsList`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiFormatsListRequest 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]
Format FormatsRead(ctx, slug).Execute()
Get a specific supported package format.
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.FormatsApi.FormatsRead(context.Background(), slug).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FormatsApi.FormatsRead``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FormatsRead`: Format
fmt.Fprintf(os.Stdout, "Response from `FormatsApi.FormatsRead`: %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 apiFormatsReadRequest 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]