Skip to content

Latest commit

 

History

History
365 lines (231 loc) · 10.3 KB

IntegrationsAPI.md

File metadata and controls

365 lines (231 loc) · 10.3 KB

\IntegrationsAPI

All URIs are relative to https://test-api.configcat.com

Method HTTP request Description
CreateIntegration Post /v1/products/{productId}/integrations Create Integration
DeleteIntegration Delete /v1/integrations/{integrationId} Delete Integration
GetIntegration Get /v1/integrations/{integrationId} Get Integration
GetIntegrations Get /v1/products/{productId}/integrations List Integrations
UpdateIntegration Put /v1/integrations/{integrationId} Update Integration

CreateIntegration

IntegrationModel CreateIntegration(ctx, productId).CreateIntegrationModel(createIntegrationModel).Execute()

Create Integration

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/configcat/configcat-publicapi-go-client/v2"
)

func main() {
	productId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Product.
	createIntegrationModel := *openapiclient.NewCreateIntegrationModel(openapiclient.IntegrationType("dataDog"), "Name_example", map[string]string{"key": "Inner_example"}, []string{"EnvironmentIds_example"}, []string{"ConfigIds_example"}) // CreateIntegrationModel | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productId string The identifier of the Product.

Other Parameters

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

Name Type Description Notes

createIntegrationModel | CreateIntegrationModel | |

Return type

IntegrationModel

Authorization

Basic

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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

DeleteIntegration

DeleteIntegration(ctx, integrationId).Execute()

Delete Integration

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/configcat/configcat-publicapi-go-client/v2"
)

func main() {
	integrationId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Integration.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.IntegrationsAPI.DeleteIntegration(context.Background(), integrationId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `IntegrationsAPI.DeleteIntegration``: %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.
integrationId string The identifier of the Integration.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

Basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetIntegration

IntegrationModel GetIntegration(ctx, integrationId).Execute()

Get Integration

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/configcat/configcat-publicapi-go-client/v2"
)

func main() {
	integrationId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Integration.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
integrationId string The identifier of the Integration.

Other Parameters

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

Name Type Description Notes

Return type

IntegrationModel

Authorization

Basic

HTTP request headers

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

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

GetIntegrations

IntegrationsModel GetIntegrations(ctx, productId).Execute()

List Integrations

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/configcat/configcat-publicapi-go-client/v2"
)

func main() {
	productId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Product.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productId string The identifier of the Product.

Other Parameters

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

Name Type Description Notes

Return type

IntegrationsModel

Authorization

Basic

HTTP request headers

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

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

UpdateIntegration

IntegrationModel UpdateIntegration(ctx, integrationId).ModifyIntegrationRequest(modifyIntegrationRequest).Execute()

Update Integration

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/configcat/configcat-publicapi-go-client/v2"
)

func main() {
	integrationId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Integration.
	modifyIntegrationRequest := *openapiclient.NewModifyIntegrationRequest("Name_example", map[string]string{"key": "Inner_example"}, []string{"EnvironmentIds_example"}, []string{"ConfigIds_example"}) // ModifyIntegrationRequest | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
integrationId string The identifier of the Integration.

Other Parameters

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

Name Type Description Notes

modifyIntegrationRequest | ModifyIntegrationRequest | |

Return type

IntegrationModel

Authorization

Basic

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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