Skip to content

Latest commit

 

History

History
350 lines (220 loc) · 8.95 KB

CustomRolesApi.md

File metadata and controls

350 lines (220 loc) · 8.95 KB

\CustomRolesApi

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

DeleteCustomRole(ctx, customRoleKey).Execute()

Delete custom role

Example

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
customRoleKey string The custom role key

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKey

HTTP request headers

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

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

GetCustomRole

CustomRole GetCustomRole(ctx, customRoleKey).Execute()

Get custom role

Example

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

Path Parameters

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

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

Name Type Description Notes

Return type

CustomRole

Authorization

ApiKey

HTTP request headers

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

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

GetCustomRoles

CustomRoles GetCustomRoles(ctx).Execute()

List custom roles

Example

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

CustomRoles

Authorization

ApiKey

HTTP request headers

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

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

PatchCustomRole

CustomRole PatchCustomRole(ctx, customRoleKey).PatchWithComment(patchWithComment).Execute()

Update custom role

Example

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
customRoleKey string The custom role key

Other Parameters

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

Name Type Description Notes

patchWithComment | PatchWithComment | |

Return type

CustomRole

Authorization

ApiKey

HTTP request headers

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

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

PostCustomRole

CustomRole PostCustomRole(ctx).CustomRolePost(customRolePost).Execute()

Create custom role

Example

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

Path Parameters

Other Parameters

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

Name Type Description Notes
customRolePost CustomRolePost

Return type

CustomRole

Authorization

ApiKey

HTTP request headers

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

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