Skip to content

Latest commit

 

History

History
578 lines (368 loc) · 15.2 KB

HooksAPI.md

File metadata and controls

578 lines (368 loc) · 15.2 KB

\HooksAPI

All URIs are relative to http://localhost

Method HTTP request Description
CreateHook Post /api/hooks Create a hook
CreateHookTest Post /api/hooks/{id}/test Test hook
DeleteHook Delete /api/hooks/{id} Delete hook
GetHook Get /api/hooks/{id} Get hook
ListHookRecentLogs Get /api/hooks/{id}/recent-logs Get recent logs for a hook
ListHooks Get /api/hooks Get hooks
UpdateHook Patch /api/hooks/{id} Update hook
UpdateHookSigningKey Patch /api/hooks/{id}/signing-key Update signing key for a hook

CreateHook

CreateHook(ctx).CreateHookRequest(createHookRequest).Execute()

Create a hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	createHookRequest := *logto.NewCreateHookRequest(*logto.NewCreateHookRequestConfig("Url_example")) // CreateHookRequest | 

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	r, err := apiClient.HooksAPI.CreateHook(context.Background()).CreateHookRequest(createHookRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.CreateHook``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

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

Name Type Description Notes
createHookRequest CreateHookRequest

Return type

(empty response body)

Authorization

ManagementApi

HTTP request headers

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

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

CreateHookTest

CreateHookTest(ctx, id).CreateHookTestRequest(createHookTestRequest).Execute()

Test hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	id := "id_example" // string | The unique identifier of the hook.
	createHookTestRequest := *logto.NewCreateHookTestRequest([]string{"Events_example"}, *logto.NewCreateHookTestRequestConfig("Url_example")) // CreateHookTestRequest | 

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	r, err := apiClient.HooksAPI.CreateHookTest(context.Background(), id).CreateHookTestRequest(createHookTestRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.CreateHookTest``: %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.
id string The unique identifier of the hook.

Other Parameters

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

Name Type Description Notes

createHookTestRequest | CreateHookTestRequest | |

Return type

(empty response body)

Authorization

ManagementApi

HTTP request headers

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

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

DeleteHook

DeleteHook(ctx, id).Execute()

Delete hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	id := "id_example" // string | The unique identifier of the hook.

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	r, err := apiClient.HooksAPI.DeleteHook(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.DeleteHook``: %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.
id string The unique identifier of the hook.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

ManagementApi

HTTP request headers

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

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

GetHook

ListHooks200ResponseInner GetHook(ctx, id).IncludeExecutionStats(includeExecutionStats).Execute()

Get hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	id := "id_example" // string | The unique identifier of the hook.
	includeExecutionStats := "includeExecutionStats_example" // string | Whether to include execution stats in the response. (optional)

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	resp, r, err := apiClient.HooksAPI.GetHook(context.Background(), id).IncludeExecutionStats(includeExecutionStats).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.GetHook``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetHook`: ListHooks200ResponseInner
	fmt.Fprintf(os.Stdout, "Response from `HooksAPI.GetHook`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

includeExecutionStats | string | Whether to include execution stats in the response. |

Return type

ListHooks200ResponseInner

Authorization

ManagementApi

HTTP request headers

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

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

ListHookRecentLogs

[]ListHookRecentLogs200ResponseInner ListHookRecentLogs(ctx, id).LogKey(logKey).Page(page).PageSize(pageSize).Execute()

Get recent logs for a hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	id := "id_example" // string | The unique identifier of the hook.
	logKey := "logKey_example" // string | The log key to filter logs. (optional)
	page := int32(56) // int32 | Page number (starts from 1). (optional) (default to 1)
	pageSize := int32(56) // int32 | Entries per page. (optional) (default to 20)

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	resp, r, err := apiClient.HooksAPI.ListHookRecentLogs(context.Background(), id).LogKey(logKey).Page(page).PageSize(pageSize).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.ListHookRecentLogs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListHookRecentLogs`: []ListHookRecentLogs200ResponseInner
	fmt.Fprintf(os.Stdout, "Response from `HooksAPI.ListHookRecentLogs`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

logKey | string | The log key to filter logs. | page | int32 | Page number (starts from 1). | [default to 1] pageSize | int32 | Entries per page. | [default to 20]

Return type

[]ListHookRecentLogs200ResponseInner

Authorization

ManagementApi

HTTP request headers

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

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

ListHooks

[]ListHooks200ResponseInner ListHooks(ctx).IncludeExecutionStats(includeExecutionStats).Page(page).PageSize(pageSize).Execute()

Get hooks

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	includeExecutionStats := "includeExecutionStats_example" // string | Whether to include execution stats in the response. (optional)
	page := int32(56) // int32 | Page number (starts from 1). (optional) (default to 1)
	pageSize := int32(56) // int32 | Entries per page. (optional) (default to 20)

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	resp, r, err := apiClient.HooksAPI.ListHooks(context.Background()).IncludeExecutionStats(includeExecutionStats).Page(page).PageSize(pageSize).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.ListHooks``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListHooks`: []ListHooks200ResponseInner
	fmt.Fprintf(os.Stdout, "Response from `HooksAPI.ListHooks`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
includeExecutionStats string Whether to include execution stats in the response.
page int32 Page number (starts from 1). [default to 1]
pageSize int32 Entries per page. [default to 20]

Return type

[]ListHooks200ResponseInner

Authorization

ManagementApi

HTTP request headers

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

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

UpdateHook

UpdateHook200Response UpdateHook(ctx, id).UpdateHookRequest(updateHookRequest).Execute()

Update hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	id := "id_example" // string | The unique identifier of the hook.
	updateHookRequest := *logto.NewUpdateHookRequest() // UpdateHookRequest | 

	configuration := logto.NewConfiguration()
	apiClient := logto.NewAPIClient(configuration)
	resp, r, err := apiClient.HooksAPI.UpdateHook(context.Background(), id).UpdateHookRequest(updateHookRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `HooksAPI.UpdateHook``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateHook`: UpdateHook200Response
	fmt.Fprintf(os.Stdout, "Response from `HooksAPI.UpdateHook`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

updateHookRequest | UpdateHookRequest | |

Return type

UpdateHook200Response

Authorization

ManagementApi

HTTP request headers

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

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

UpdateHookSigningKey

UpdateHook200Response UpdateHookSigningKey(ctx, id).Execute()

Update signing key for a hook

Example

package main

import (
	"context"
	"fmt"
	"os"
	logto "github.com/mostafa/go-api-client"
)

func main() {
	id := "id_example" // string | The unique identifier of the hook.

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

UpdateHook200Response

Authorization

ManagementApi

HTTP request headers

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

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