Skip to content

Latest commit

 

History

History
357 lines (225 loc) · 9.02 KB

UserGroupAPI.md

File metadata and controls

357 lines (225 loc) · 9.02 KB

\UserGroupAPI

All URIs are relative to https://localhost:8080

Method HTTP request Description
CreateUserGroup Post /api/usergroups Create user group.
DeleteUserGroup Delete /api/usergroups/{groupId} Delete user group.
GetUserGroup Get /api/usergroups/{groupId} Get user group details.
ListUserGroups Get /api/usergroups List user groups.
UpdateUserGroup Put /api/usergroups/{groupId} Update user group.

CreateUserGroup

ApiResponse CreateUserGroup(ctx).UserGroup(userGroup).Execute()

Create user group.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/TykTechnologies/dashboard-sdk"
)

func main() {
	userGroup := *openapiclient.NewUserGroup() // UserGroup |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
userGroup UserGroup

Return type

ApiResponse

Authorization

bearerAuth

HTTP request headers

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

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

DeleteUserGroup

ApiResponse DeleteUserGroup(ctx, groupId).Execute()

Delete user group.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/TykTechnologies/dashboard-sdk"
)

func main() {
	groupId := "6649fd535715ec4c96cbef39" // string | ID of the group you want to delete.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
groupId string ID of the group you want to delete.

Other Parameters

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

Name Type Description Notes

Return type

ApiResponse

Authorization

bearerAuth

HTTP request headers

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

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

GetUserGroup

UserGroup GetUserGroup(ctx, groupId).Execute()

Get user group details.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/TykTechnologies/dashboard-sdk"
)

func main() {
	groupId := "6649fd535715ec4c96cbef39" // string | ID of the group you want to fetch.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
groupId string ID of the group you want to fetch.

Other Parameters

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

Name Type Description Notes

Return type

UserGroup

Authorization

bearerAuth

HTTP request headers

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

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

ListUserGroups

UserGroups ListUserGroups(ctx).P(p).Execute()

List user groups.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/TykTechnologies/dashboard-sdk"
)

func main() {
	p := int32(1) // int32 | Use p query parameter to say which page you want returned. Send number less than 0 to return all items. (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
p int32 Use p query parameter to say which page you want returned. Send number less than 0 to return all items.

Return type

UserGroups

Authorization

bearerAuth

HTTP request headers

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

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

UpdateUserGroup

ApiResponse UpdateUserGroup(ctx, groupId).UserGroup(userGroup).Execute()

Update user group.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/TykTechnologies/dashboard-sdk"
)

func main() {
	groupId := "6649fd535715ec4c96cbef39" // string | ID of the group you want to update.
	userGroup := *openapiclient.NewUserGroup() // UserGroup |  (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
groupId string ID of the group you want to update.

Other Parameters

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

Name Type Description Notes

userGroup | UserGroup | |

Return type

ApiResponse

Authorization

bearerAuth

HTTP request headers

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

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