Skip to content

Latest commit

 

History

History
350 lines (220 loc) · 8.72 KB

File metadata and controls

350 lines (220 loc) · 8.72 KB

\OAuth2ClientsApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
CreateOAuth2Client Post /api/v2/oauth/clients Create a LaunchDarkly OAuth 2.0 client
DeleteOAuthClient Delete /api/v2/oauth/clients/{clientId} Delete OAuth 2.0 client
GetOAuthClientById Get /api/v2/oauth/clients/{clientId} Get client by ID
GetOAuthClients Get /api/v2/oauth/clients Get clients
PatchOAuthClient Patch /api/v2/oauth/clients/{clientId} Patch client by ID

CreateOAuth2Client

Client CreateOAuth2Client(ctx).OauthClientPost(oauthClientPost).Execute()

Create a LaunchDarkly OAuth 2.0 client

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	oauthClientPost := *openapiclient.NewOauthClientPost() // OauthClientPost | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
oauthClientPost OauthClientPost

Return type

Client

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]

DeleteOAuthClient

DeleteOAuthClient(ctx, clientId).Execute()

Delete OAuth 2.0 client

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	clientId := "clientId_example" // string | The client ID

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.OAuth2ClientsApi.DeleteOAuthClient(context.Background(), clientId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `OAuth2ClientsApi.DeleteOAuthClient``: %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.
clientId string The client ID

Other Parameters

Other parameters are passed through a pointer to a apiDeleteOAuthClientRequest 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]

GetOAuthClientById

Client GetOAuthClientById(ctx, clientId).Execute()

Get client by ID

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	clientId := "clientId_example" // string | The client ID

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
clientId string The client ID

Other Parameters

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

Name Type Description Notes

Return type

Client

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]

GetOAuthClients

ClientCollection GetOAuthClients(ctx).Execute()

Get clients

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ClientCollection

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]

PatchOAuthClient

Client PatchOAuthClient(ctx, clientId).PatchOperation(patchOperation).Execute()

Patch client by ID

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/launchdarkly/api-client-go"
)

func main() {
	clientId := "clientId_example" // string | The client ID
	patchOperation := []openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField")} // []PatchOperation | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
clientId string The client ID

Other Parameters

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

Name Type Description Notes

patchOperation | []PatchOperation | |

Return type

Client

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]