All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
DeleteCustomRole | Delete /api/v2/roles/{customRoleKey} | Delete custom role |
GetCustomRole | Get /api/v2/roles/{customRoleKey} | Get custom role |
GetCustomRoles | Get /api/v2/roles | List custom roles |
PatchCustomRole | Patch /api/v2/roles/{customRoleKey} | Update custom role |
PostCustomRole | Post /api/v2/roles | Create custom role |
DeleteCustomRole(ctx, customRoleKey).Execute()
Delete custom role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
customRoleKey := "customRoleKey_example" // string | The custom role key
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.CustomRolesApi.DeleteCustomRole(context.Background(), customRoleKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomRolesApi.DeleteCustomRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customRoleKey | string | The custom role key |
Other parameters are passed through a pointer to a apiDeleteCustomRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomRole GetCustomRole(ctx, customRoleKey).Execute()
Get custom role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
customRoleKey := "customRoleKey_example" // string | The custom role key or ID
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.CustomRolesApi.GetCustomRole(context.Background(), customRoleKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomRolesApi.GetCustomRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetCustomRole`: CustomRole
fmt.Fprintf(os.Stdout, "Response from `CustomRolesApi.GetCustomRole`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customRoleKey | string | The custom role key or ID |
Other parameters are passed through a pointer to a apiGetCustomRoleRequest 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]
CustomRoles GetCustomRoles(ctx).Execute()
List custom roles
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.CustomRolesApi.GetCustomRoles(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomRolesApi.GetCustomRoles``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetCustomRoles`: CustomRoles
fmt.Fprintf(os.Stdout, "Response from `CustomRolesApi.GetCustomRoles`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetCustomRolesRequest 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]
CustomRole PatchCustomRole(ctx, customRoleKey).PatchWithComment(patchWithComment).Execute()
Update custom role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
customRoleKey := "customRoleKey_example" // string | The custom role key
patchWithComment := *openapiclient.NewPatchWithComment([]openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField", interface{}(new example value))}) // PatchWithComment |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.CustomRolesApi.PatchCustomRole(context.Background(), customRoleKey).PatchWithComment(patchWithComment).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomRolesApi.PatchCustomRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchCustomRole`: CustomRole
fmt.Fprintf(os.Stdout, "Response from `CustomRolesApi.PatchCustomRole`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customRoleKey | string | The custom role key |
Other parameters are passed through a pointer to a apiPatchCustomRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
patchWithComment | PatchWithComment | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomRole PostCustomRole(ctx).CustomRolePost(customRolePost).Execute()
Create custom role
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
customRolePost := *openapiclient.NewCustomRolePost("Name_example", "Key_example", []openapiclient.StatementPost{*openapiclient.NewStatementPost("Effect_example")}) // CustomRolePost |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.CustomRolesApi.PostCustomRole(context.Background()).CustomRolePost(customRolePost).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CustomRolesApi.PostCustomRole``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostCustomRole`: CustomRole
fmt.Fprintf(os.Stdout, "Response from `CustomRolesApi.PostCustomRole`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiPostCustomRoleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
customRolePost | CustomRolePost |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]