Skip to content

Latest commit

 

History

History
288 lines (182 loc) · 8.12 KB

GroupsAPI.md

File metadata and controls

288 lines (182 loc) · 8.12 KB

\GroupsAPI

All URIs are relative to http://localhost

Method HTTP request Description
CreateGroup Post /groups Create a new group
DeleteGroupById Delete /groups/{groupId} Delete a group by the specified ID.
GetGroupById Get /groups/{groupId} Get a group by the specified ID.
ListGroups Get /groups List groups

CreateGroup

GroupMetaData CreateGroup(ctx).CreateGroupMetaData(createGroupMetaData).Execute()

Create a new group

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/Apicurio/apicurio-registry-client-sdk-go"
)

func main() {
    createGroupMetaData := *openapiclient.NewCreateGroupMetaData("Id_example") // CreateGroupMetaData | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GroupsAPI.CreateGroup(context.Background()).CreateGroupMetaData(createGroupMetaData).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.CreateGroup``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateGroup`: GroupMetaData
    fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.CreateGroup`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
createGroupMetaData CreateGroupMetaData

Return type

GroupMetaData

Authorization

No authorization required

HTTP request headers

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

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

DeleteGroupById

DeleteGroupById(ctx, groupId).Execute()

Delete a group by the specified ID.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/Apicurio/apicurio-registry-client-sdk-go"
)

func main() {
    groupId := "groupId_example" // string | The artifact group ID.  Must be a string provided by the client, representing the name of the grouping of artifacts.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.GroupsAPI.DeleteGroupById(context.Background(), groupId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.DeleteGroupById``: %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.
groupId string The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

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

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

GetGroupById

GroupMetaData GetGroupById(ctx, groupId).Execute()

Get a group by the specified ID.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/Apicurio/apicurio-registry-client-sdk-go"
)

func main() {
    groupId := "groupId_example" // string | The artifact group ID.  Must be a string provided by the client, representing the name of the grouping of artifacts.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GroupsAPI.GetGroupById(context.Background(), groupId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.GetGroupById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetGroupById`: GroupMetaData
    fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.GetGroupById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
groupId string The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts.

Other Parameters

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

Name Type Description Notes

Return type

GroupMetaData

Authorization

No authorization required

HTTP request headers

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

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

ListGroups

GroupSearchResults ListGroups(ctx).Limit(limit).Offset(offset).Order(order).Orderby(orderby).Execute()

List groups

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/Apicurio/apicurio-registry-client-sdk-go"
)

func main() {
    limit := int32(56) // int32 | The number of groups to return.  Defaults to 20. (optional)
    offset := int32(56) // int32 | The number of groups to skip before starting the result set.  Defaults to 0. (optional)
    order := openapiclient.SortOrder("asc") // SortOrder | Sort order, ascending (`asc`) or descending (`desc`). (optional)
    orderby := openapiclient.SortBy("name") // SortBy | The field to sort by.  Can be one of:  * `name` * `createdOn`  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.GroupsAPI.ListGroups(context.Background()).Limit(limit).Offset(offset).Order(order).Orderby(orderby).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GroupsAPI.ListGroups``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListGroups`: GroupSearchResults
    fmt.Fprintf(os.Stdout, "Response from `GroupsAPI.ListGroups`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32 The number of groups to return. Defaults to 20.
offset int32 The number of groups to skip before starting the result set. Defaults to 0.
order SortOrder Sort order, ascending (`asc`) or descending (`desc`).
orderby SortBy The field to sort by. Can be one of: * `name` * `createdOn`

Return type

GroupSearchResults

Authorization

No authorization required

HTTP request headers

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

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