diff --git a/.changeset/auto-bump-magicbell-go-1762754532.md b/.changeset/auto-bump-magicbell-go-1762754532.md new file mode 100644 index 0000000..114cff5 --- /dev/null +++ b/.changeset/auto-bump-magicbell-go-1762754532.md @@ -0,0 +1,5 @@ +--- +"magicbell-go": minor +--- + +Automatic minor version bump for changes in `magicbell-go`. diff --git a/README.md b/README.md index 37488ea..7aced6a 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,60 @@ sdk := client.NewClient(config) sdk.SetAccessToken("YOUR-TOKEN") ``` +## Setting a Custom Timeout + +You can set a custom timeout for the SDK's HTTP requests as follows: + +```go +import "time" + +config := clientconfig.NewConfig() + +sdk := client.NewClient(config) + +sdk.SetTimeout(10 * time.Second) +``` + +# Sample Usage + +Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint: + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/broadcasts" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +params := broadcasts.ListBroadcastsRequestParams{ + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), +} + +response, err := client.Broadcasts.ListBroadcasts(context.Background(), params) +if err != nil { + panic(err) +} + +fmt.Println(response) + +``` + ## Services The SDK provides various services to interact with the API. -
+
Below is a list of all available services with links to their detailed documentation: | Name | @@ -62,6 +111,7 @@ The SDK provides various services to interact with the API. | [EventsService](docs/project-client/services/events_service.md) | | [IntegrationsService](docs/project-client/services/integrations_service.md) | | [UsersService](docs/project-client/services/users_service.md) | +| [WorkflowsService](docs/project-client/services/workflows_service.md) |
@@ -108,16 +158,19 @@ This struct is shared by both response wrappers and contains the following field The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. -
+
Below is a list of all available models with links to their detailed documentation: | Name | Description | | :-------------------------------------------------------------------------------------- | :---------- | | [BroadcastCollection](docs/project-client/models/broadcast_collection.md) | | | [Broadcast](docs/project-client/models/broadcast.md) | | +| [User](docs/project-client/models/user.md) | | +| [Links](docs/project-client/models/links.md) | | | [CategoryDeliveryConfig](docs/project-client/models/category_delivery_config.md) | | | [InboxTokenResponseCollection](docs/project-client/models/inbox_token_response_collection.md) | | | [InboxTokenResponse](docs/project-client/models/inbox_token_response.md) | | +| [Links](docs/project-client/models/links.md) | | | [DiscardResult](docs/project-client/models/discard_result.md) | | | [ApnsTokenCollection](docs/project-client/models/apns_token_collection.md) | | | [ApnsToken](docs/project-client/models/apns_token.md) | | @@ -133,50 +186,65 @@ The SDK includes several models that represent the data structures used in API r | [WebPushToken](docs/project-client/models/web_push_token.md) | | | [EventCollection](docs/project-client/models/event_collection.md) | | | [Event](docs/project-client/models/event.md) | | +| [Links](docs/project-client/models/links.md) | | | [IntegrationConfigCollection](docs/project-client/models/integration_config_collection.md) | | +| [IntegrationConfig](docs/project-client/models/integration_config.md) | | +| [Links](docs/project-client/models/links.md) | | | [ApnsConfigCollection](docs/project-client/models/apns_config_collection.md) | | +| [ApnsConfig](docs/project-client/models/apns_config.md) | | | [ApnsConfigPayload](docs/project-client/models/apns_config_payload.md) | | +| [EventSourceConfigCollection](docs/project-client/models/event_source_config_collection.md) | | +| [EventSourceConfig](docs/project-client/models/event_source_config.md) | | +| [EventSourceConfigPayload](docs/project-client/models/event_source_config_payload.md) | | | [ExpoConfigCollection](docs/project-client/models/expo_config_collection.md) | | +| [ExpoConfig](docs/project-client/models/expo_config.md) | | | [ExpoConfigPayload](docs/project-client/models/expo_config_payload.md) | | | [FcmConfigCollection](docs/project-client/models/fcm_config_collection.md) | | +| [FcmConfig](docs/project-client/models/fcm_config.md) | | | [FcmConfigPayload](docs/project-client/models/fcm_config_payload.md) | | | [GithubConfigCollection](docs/project-client/models/github_config_collection.md) | | +| [GithubConfig](docs/project-client/models/github_config.md) | | | [GithubConfigPayload](docs/project-client/models/github_config_payload.md) | | | [InboxConfigCollection](docs/project-client/models/inbox_config_collection.md) | | +| [InboxConfig](docs/project-client/models/inbox_config.md) | | | [InboxConfigPayload](docs/project-client/models/inbox_config_payload.md) | | | [MailgunConfigCollection](docs/project-client/models/mailgun_config_collection.md) | | +| [MailgunConfig](docs/project-client/models/mailgun_config.md) | | | [MailgunConfigPayload](docs/project-client/models/mailgun_config_payload.md) | | | [PingConfigCollection](docs/project-client/models/ping_config_collection.md) | | +| [PingConfig](docs/project-client/models/ping_config.md) | | | [PingConfigPayload](docs/project-client/models/ping_config_payload.md) | | | [SendgridConfigCollection](docs/project-client/models/sendgrid_config_collection.md) | | +| [SendgridConfig](docs/project-client/models/sendgrid_config.md) | | | [SendgridConfigPayload](docs/project-client/models/sendgrid_config_payload.md) | | | [SesConfigCollection](docs/project-client/models/ses_config_collection.md) | | +| [SesConfig](docs/project-client/models/ses_config.md) | | | [SesConfigPayload](docs/project-client/models/ses_config_payload.md) | | | [SlackConfigCollection](docs/project-client/models/slack_config_collection.md) | | +| [SlackConfig](docs/project-client/models/slack_config.md) | | | [SlackConfigPayload](docs/project-client/models/slack_config_payload.md) | | +| [SmtpConfigObjectCollection](docs/project-client/models/smtp_config_object_collection.md) | | +| [SmtpConfigObject](docs/project-client/models/smtp_config_object.md) | | +| [SmtpConfig](docs/project-client/models/smtp_config.md) | | | [StripeConfigCollection](docs/project-client/models/stripe_config_collection.md) | | +| [StripeConfig](docs/project-client/models/stripe_config.md) | | | [StripeConfigPayload](docs/project-client/models/stripe_config_payload.md) | | | [TwilioConfigCollection](docs/project-client/models/twilio_config_collection.md) | | +| [TwilioConfig](docs/project-client/models/twilio_config.md) | | | [TwilioConfigPayload](docs/project-client/models/twilio_config_payload.md) | | | [WebpushConfigCollection](docs/project-client/models/webpush_config_collection.md) | | +| [WebpushConfig](docs/project-client/models/webpush_config.md) | | | [WebpushConfigPayload](docs/project-client/models/webpush_config_payload.md) | | | [UserCollection](docs/project-client/models/user_collection.md) | | | [User](docs/project-client/models/user.md) | | | [Links](docs/project-client/models/links.md) | | -| [IntegrationConfig](docs/project-client/models/integration_config.md) | | -| [ApnsConfig](docs/project-client/models/apns_config.md) | | -| [ExpoConfig](docs/project-client/models/expo_config.md) | | -| [FcmConfig](docs/project-client/models/fcm_config.md) | | -| [GithubConfig](docs/project-client/models/github_config.md) | | -| [InboxConfig](docs/project-client/models/inbox_config.md) | | -| [MailgunConfig](docs/project-client/models/mailgun_config.md) | | -| [PingConfig](docs/project-client/models/ping_config.md) | | -| [SendgridConfig](docs/project-client/models/sendgrid_config.md) | | -| [SesConfig](docs/project-client/models/ses_config.md) | | -| [SlackConfig](docs/project-client/models/slack_config.md) | | -| [StripeConfig](docs/project-client/models/stripe_config.md) | | -| [TwilioConfig](docs/project-client/models/twilio_config.md) | | -| [WebpushConfig](docs/project-client/models/webpush_config.md) | | +| [WorkflowDefinition](docs/project-client/models/workflow_definition.md) | | +| [ExecuteWorkflowRequest](docs/project-client/models/execute_workflow_request.md) | | +| [CreateRunResponse](docs/project-client/models/create_run_response.md) | | +| [GetRunResponse](docs/project-client/models/get_run_response.md) | | +| [WorkflowRunCollection](docs/project-client/models/workflow_run_collection.md) | | +| [WorkflowRun](docs/project-client/models/workflow_run.md) | | +| [Links](docs/project-client/models/links.md) | |
@@ -224,11 +292,60 @@ sdk := client.NewClient(config) sdk.SetAccessToken("YOUR-TOKEN") ``` +## Setting a Custom Timeout + +You can set a custom timeout for the SDK's HTTP requests as follows: + +```go +import "time" + +config := clientconfig.NewConfig() + +sdk := client.NewClient(config) + +sdk.SetTimeout(10 * time.Second) +``` + +# Sample Usage + +Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint: + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/user-client/client" + "github.com/magicbell/magicbell-go/pkg/user-client/util" + "github.com/magicbell/magicbell-go/pkg/user-client/channels" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +params := channels.ListInboxTokensRequestParams{ + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), +} + +response, err := client.Channels.ListInboxTokens(context.Background(), params) +if err != nil { + panic(err) +} + +fmt.Println(response) + +``` + ## Services The SDK provides various services to interact with the API. -
+
Below is a list of all available services with links to their detailed documentation: | Name | @@ -282,38 +399,41 @@ This struct is shared by both response wrappers and contains the following field The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. -
+
Below is a list of all available models with links to their detailed documentation: | Name | Description | | :----------------------------------------------------------------------------------------------- | :---------- | | [InboxTokenResponseCollection](docs/user-client/models/inbox_token_response_collection.md) | | -| [InboxToken](docs/user-client/models/inbox_token.md) | | | [InboxTokenResponse](docs/user-client/models/inbox_token_response.md) | | +| [Links](docs/user-client/models/links.md) | | +| [InboxToken](docs/user-client/models/inbox_token.md) | | | [DiscardResult](docs/user-client/models/discard_result.md) | | | [ApnsTokenCollection](docs/user-client/models/apns_token_collection.md) | | -| [ApnsTokenPayload](docs/user-client/models/apns_token_payload.md) | | | [ApnsToken](docs/user-client/models/apns_token.md) | | +| [ApnsTokenPayload](docs/user-client/models/apns_token_payload.md) | | | [ExpoTokenCollection](docs/user-client/models/expo_token_collection.md) | | -| [ExpoTokenPayload](docs/user-client/models/expo_token_payload.md) | | | [ExpoToken](docs/user-client/models/expo_token.md) | | +| [ExpoTokenPayload](docs/user-client/models/expo_token_payload.md) | | | [FcmTokenCollection](docs/user-client/models/fcm_token_collection.md) | | -| [FcmTokenPayload](docs/user-client/models/fcm_token_payload.md) | | | [FcmToken](docs/user-client/models/fcm_token.md) | | +| [FcmTokenPayload](docs/user-client/models/fcm_token_payload.md) | | | [SlackTokenCollection](docs/user-client/models/slack_token_collection.md) | | -| [SlackTokenPayload](docs/user-client/models/slack_token_payload.md) | | | [SlackToken](docs/user-client/models/slack_token.md) | | +| [SlackTokenPayload](docs/user-client/models/slack_token_payload.md) | | | [TeamsTokenCollection](docs/user-client/models/teams_token_collection.md) | | -| [TeamsTokenPayload](docs/user-client/models/teams_token_payload.md) | | | [TeamsToken](docs/user-client/models/teams_token.md) | | +| [TeamsTokenPayload](docs/user-client/models/teams_token_payload.md) | | +| [UserPreferences](docs/user-client/models/user_preferences.md) | | | [WebPushTokenCollection](docs/user-client/models/web_push_token_collection.md) | | -| [WebPushTokenPayload](docs/user-client/models/web_push_token_payload.md) | | | [WebPushToken](docs/user-client/models/web_push_token.md) | | +| [WebPushTokenPayload](docs/user-client/models/web_push_token_payload.md) | | | [InboxConfigPayload](docs/user-client/models/inbox_config_payload.md) | | | [SlackInstallation](docs/user-client/models/slack_installation.md) | | | [SlackFinishInstallResponse](docs/user-client/models/slack_finish_install_response.md) | | | [SlackStartInstall](docs/user-client/models/slack_start_install.md) | | | [SlackStartInstallResponseContent](docs/user-client/models/slack_start_install_response_content.md) | | +| [WebPushTokenPayload](docs/user-client/models/web_push_token_payload.md) | | | [WebPushStartInstallationResponse](docs/user-client/models/web_push_start_installation_response.md) | | | [NotificationCollection](docs/user-client/models/notification_collection.md) | | | [Notification](docs/user-client/models/notification.md) | | diff --git a/cmd/project-client/examples/example.go b/cmd/project-client/examples/example.go index be3d60f..f0cdf5f 100644 --- a/cmd/project-client/examples/example.go +++ b/cmd/project-client/examples/example.go @@ -2,15 +2,15 @@ package main import ( "bufio" - "context" "fmt" "os" "strings" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/broadcasts" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" - - "github.com/magicbell/magicbell-go/pkg/project-client/broadcasts" + "github.com/magicbell/magicbell-go/pkg/project-client/util" ) func main() { @@ -19,7 +19,11 @@ func main() { config := clientconfig.NewConfig() client := client.NewClient(config) - params := broadcasts.ListBroadcastsRequestParams{} + params := broadcasts.ListBroadcastsRequestParams{ + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), + } response, err := client.Broadcasts.ListBroadcasts(context.Background(), params) if err != nil { diff --git a/cmd/user-client/examples/example.go b/cmd/user-client/examples/example.go index 4b0ed6a..5e892df 100644 --- a/cmd/user-client/examples/example.go +++ b/cmd/user-client/examples/example.go @@ -2,15 +2,15 @@ package main import ( "bufio" - "context" "fmt" "os" "strings" + "context" + "github.com/magicbell/magicbell-go/pkg/user-client/channels" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" - - "github.com/magicbell/magicbell-go/pkg/user-client/channels" + "github.com/magicbell/magicbell-go/pkg/user-client/util" ) func main() { @@ -19,7 +19,11 @@ func main() { config := clientconfig.NewConfig() client := client.NewClient(config) - params := channels.ListInboxTokensRequestParams{} + params := channels.ListInboxTokensRequestParams{ + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), + } response, err := client.Channels.ListInboxTokens(context.Background(), params) if err != nil { diff --git a/docs/project-client/README.md b/docs/project-client/README.md index 5b6f4d6..a06d4f4 100644 --- a/docs/project-client/README.md +++ b/docs/project-client/README.md @@ -8,6 +8,14 @@ title: "project-client" This SDK is compatible with the following versions: `Go >= 1.19.0` +## Installation + +To get started with the SDK, we recommend installing using `go get`: + +```bash +go get client +``` + ## Authentication ### Access Token Authentication @@ -46,11 +54,60 @@ sdk := client.NewClient(config) sdk.SetAccessToken("YOUR-TOKEN") ``` +## Setting a Custom Timeout + +You can set a custom timeout for the SDK's HTTP requests as follows: + +```go +import "time" + +config := clientconfig.NewConfig() + +sdk := client.NewClient(config) + +sdk.SetTimeout(10 * time.Second) +``` + +# Sample Usage + +Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint: + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/broadcasts" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +params := broadcasts.ListBroadcastsRequestParams{ + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), +} + +response, err := client.Broadcasts.ListBroadcasts(context.Background(), params) +if err != nil { + panic(err) +} + +fmt.Println(response) + +``` + ## Services The SDK provides various services to interact with the API. -
+
Below is a list of all available services with links to their detailed documentation: | Name | @@ -60,6 +117,7 @@ The SDK provides various services to interact with the API. | [EventsService](services/events_service.md) | | [IntegrationsService](services/integrations_service.md) | | [UsersService](services/users_service.md) | +| [WorkflowsService](services/workflows_service.md) |
@@ -106,16 +164,19 @@ This struct is shared by both response wrappers and contains the following field The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. -
+
Below is a list of all available models with links to their detailed documentation: | Name | Description | | :-------------------------------------------------------------------------------------- | :---------- | | [BroadcastCollection](models/broadcast_collection.md) | | | [Broadcast](models/broadcast.md) | | +| [User](models/user.md) | | +| [Links](models/links.md) | | | [CategoryDeliveryConfig](models/category_delivery_config.md) | | | [InboxTokenResponseCollection](models/inbox_token_response_collection.md) | | | [InboxTokenResponse](models/inbox_token_response.md) | | +| [Links](models/links.md) | | | [DiscardResult](models/discard_result.md) | | | [ApnsTokenCollection](models/apns_token_collection.md) | | | [ApnsToken](models/apns_token.md) | | @@ -131,49 +192,64 @@ The SDK includes several models that represent the data structures used in API r | [WebPushToken](models/web_push_token.md) | | | [EventCollection](models/event_collection.md) | | | [Event](models/event.md) | | +| [Links](models/links.md) | | | [IntegrationConfigCollection](models/integration_config_collection.md) | | +| [IntegrationConfig](models/integration_config.md) | | +| [Links](models/links.md) | | | [ApnsConfigCollection](models/apns_config_collection.md) | | +| [ApnsConfig](models/apns_config.md) | | | [ApnsConfigPayload](models/apns_config_payload.md) | | +| [EventSourceConfigCollection](models/event_source_config_collection.md) | | +| [EventSourceConfig](models/event_source_config.md) | | +| [EventSourceConfigPayload](models/event_source_config_payload.md) | | | [ExpoConfigCollection](models/expo_config_collection.md) | | +| [ExpoConfig](models/expo_config.md) | | | [ExpoConfigPayload](models/expo_config_payload.md) | | | [FcmConfigCollection](models/fcm_config_collection.md) | | +| [FcmConfig](models/fcm_config.md) | | | [FcmConfigPayload](models/fcm_config_payload.md) | | | [GithubConfigCollection](models/github_config_collection.md) | | +| [GithubConfig](models/github_config.md) | | | [GithubConfigPayload](models/github_config_payload.md) | | | [InboxConfigCollection](models/inbox_config_collection.md) | | +| [InboxConfig](models/inbox_config.md) | | | [InboxConfigPayload](models/inbox_config_payload.md) | | | [MailgunConfigCollection](models/mailgun_config_collection.md) | | +| [MailgunConfig](models/mailgun_config.md) | | | [MailgunConfigPayload](models/mailgun_config_payload.md) | | | [PingConfigCollection](models/ping_config_collection.md) | | +| [PingConfig](models/ping_config.md) | | | [PingConfigPayload](models/ping_config_payload.md) | | | [SendgridConfigCollection](models/sendgrid_config_collection.md) | | +| [SendgridConfig](models/sendgrid_config.md) | | | [SendgridConfigPayload](models/sendgrid_config_payload.md) | | | [SesConfigCollection](models/ses_config_collection.md) | | +| [SesConfig](models/ses_config.md) | | | [SesConfigPayload](models/ses_config_payload.md) | | | [SlackConfigCollection](models/slack_config_collection.md) | | +| [SlackConfig](models/slack_config.md) | | | [SlackConfigPayload](models/slack_config_payload.md) | | +| [SmtpConfigObjectCollection](models/smtp_config_object_collection.md) | | +| [SmtpConfigObject](models/smtp_config_object.md) | | +| [SmtpConfig](models/smtp_config.md) | | | [StripeConfigCollection](models/stripe_config_collection.md) | | +| [StripeConfig](models/stripe_config.md) | | | [StripeConfigPayload](models/stripe_config_payload.md) | | | [TwilioConfigCollection](models/twilio_config_collection.md) | | +| [TwilioConfig](models/twilio_config.md) | | | [TwilioConfigPayload](models/twilio_config_payload.md) | | | [WebpushConfigCollection](models/webpush_config_collection.md) | | +| [WebpushConfig](models/webpush_config.md) | | | [WebpushConfigPayload](models/webpush_config_payload.md) | | | [UserCollection](models/user_collection.md) | | | [User](models/user.md) | | | [Links](models/links.md) | | -| [IntegrationConfig](models/integration_config.md) | | -| [ApnsConfig](models/apns_config.md) | | -| [ExpoConfig](models/expo_config.md) | | -| [FcmConfig](models/fcm_config.md) | | -| [GithubConfig](models/github_config.md) | | -| [InboxConfig](models/inbox_config.md) | | -| [MailgunConfig](models/mailgun_config.md) | | -| [PingConfig](models/ping_config.md) | | -| [SendgridConfig](models/sendgrid_config.md) | | -| [SesConfig](models/ses_config.md) | | -| [SlackConfig](models/slack_config.md) | | -| [StripeConfig](models/stripe_config.md) | | -| [TwilioConfig](models/twilio_config.md) | | -| [WebpushConfig](models/webpush_config.md) | | +| [WorkflowDefinition](models/workflow_definition.md) | | +| [ExecuteWorkflowRequest](models/execute_workflow_request.md) | | +| [CreateRunResponse](models/create_run_response.md) | | +| [GetRunResponse](models/get_run_response.md) | | +| [WorkflowRunCollection](models/workflow_run_collection.md) | | +| [WorkflowRun](models/workflow_run.md) | | +| [Links](models/links.md) | |
diff --git a/docs/project-client/models/apns_config.md b/docs/project-client/models/apns_config.md index fcebe37..e030eab 100644 --- a/docs/project-client/models/apns_config.md +++ b/docs/project-client/models/apns_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :----------------------------- | :------- | :---------- | -| Config | integrations.ApnsConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.ApnsConfigPayload](apns_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/apns_config_collection.md b/docs/project-client/models/apns_config_collection.md index 6813be7..b846a8c 100644 --- a/docs/project-client/models/apns_config_collection.md +++ b/docs/project-client/models/apns_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------ | :------- | :---------- | -| Data | []integrations.ApnsConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------ | :------- | :---------- | +| Data | [][integrations.ApnsConfig](apns_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/apns_config_payload.md b/docs/project-client/models/apns_config_payload.md index a7fca2d..8fec6c1 100644 --- a/docs/project-client/models/apns_config_payload.md +++ b/docs/project-client/models/apns_config_payload.md @@ -17,8 +17,8 @@ | Name | Type | Required | Description | | :----- | :----- | :------- | :---------- | -| unread | string | ✅ | "unread" | -| unseen | string | ✅ | "unseen" | +| Unread | string | ✅ | "unread" | +| Unseen | string | ✅ | "unseen" | # PayloadVersion diff --git a/docs/project-client/models/apns_token.md b/docs/project-client/models/apns_token.md index 3b649d8..93bf1af 100644 --- a/docs/project-client/models/apns_token.md +++ b/docs/project-client/models/apns_token.md @@ -20,5 +20,5 @@ | Name | Type | Required | Description | | :---------- | :----- | :------- | :------------ | -| development | string | ✅ | "development" | -| production | string | ✅ | "production" | +| Development | string | ✅ | "development" | +| Production | string | ✅ | "production" | diff --git a/docs/project-client/models/apns_token_collection.md b/docs/project-client/models/apns_token_collection.md index 0b26eb2..b8638ba 100644 --- a/docs/project-client/models/apns_token_collection.md +++ b/docs/project-client/models/apns_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------- | :------- | :---------- | -| Data | []channels.ApnsToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------ | :------- | :---------- | +| Data | [][channels.ApnsToken](apns_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/broadcast.md b/docs/project-client/models/broadcast.md index cf2b9f6..691feed 100644 --- a/docs/project-client/models/broadcast.md +++ b/docs/project-client/models/broadcast.md @@ -4,7 +4,7 @@ | Name | Type | Required | Description | | :--------------- | :------------------------- | :------- | :-------------------------------------------- | -| Recipients | []shared.User | ✅ | | +| Recipients | [][shared.User](user.md) | ✅ | | | Title | string | ✅ | | | ActionUrl | string | ❌ | | | Category | string | ❌ | | @@ -117,9 +117,9 @@ | Name | Type | Required | Description | | :--------- | :----- | :------- | :----------- | -| enqueued | string | ✅ | "enqueued" | -| processing | string | ✅ | "processing" | -| processed | string | ✅ | "processed" | +| Enqueued | string | ✅ | "enqueued" | +| Processing | string | ✅ | "processing" | +| Processed | string | ✅ | "processed" | # Summary diff --git a/docs/project-client/models/broadcast_collection.md b/docs/project-client/models/broadcast_collection.md index a615440..3e48a76 100644 --- a/docs/project-client/models/broadcast_collection.md +++ b/docs/project-client/models/broadcast_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :--------------------- | :------- | :---------- | -| Data | []broadcasts.Broadcast | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------- | :------- | :---------- | +| Data | [][broadcasts.Broadcast](broadcast.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/category_delivery_config.md b/docs/project-client/models/category_delivery_config.md index d522394..f869088 100644 --- a/docs/project-client/models/category_delivery_config.md +++ b/docs/project-client/models/category_delivery_config.md @@ -22,12 +22,12 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :----- | :------- | :------------ | -| in_app | string | ✅ | "in_app" | -| slack | string | ✅ | "slack" | -| web_push | string | ✅ | "web_push" | -| mobile_push | string | ✅ | "mobile_push" | -| teams | string | ✅ | "teams" | -| email | string | ✅ | "email" | -| sms | string | ✅ | "sms" | +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :------------ | +| InApp | string | ✅ | "in_app" | +| Slack | string | ✅ | "slack" | +| WebPush | string | ✅ | "web_push" | +| MobilePush | string | ✅ | "mobile_push" | +| Teams | string | ✅ | "teams" | +| Email | string | ✅ | "email" | +| Sms | string | ✅ | "sms" | diff --git a/docs/project-client/models/create_run_response.md b/docs/project-client/models/create_run_response.md new file mode 100644 index 0000000..b014b1e --- /dev/null +++ b/docs/project-client/models/create_run_response.md @@ -0,0 +1,7 @@ +# CreateRunResponse + +**Properties** + +| Name | Type | Required | Description | +| :--- | :----- | :------- | :---------- | +| Id | string | ✅ | | diff --git a/docs/project-client/models/event_collection.md b/docs/project-client/models/event_collection.md index 190c0a6..a8670cf 100644 --- a/docs/project-client/models/event_collection.md +++ b/docs/project-client/models/event_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------- | :------- | :---------- | -| Data | []events.Event | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------- | :------- | :---------- | +| Data | [][events.Event](event.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/event_source_config.md b/docs/project-client/models/event_source_config.md new file mode 100644 index 0000000..724dc71 --- /dev/null +++ b/docs/project-client/models/event_source_config.md @@ -0,0 +1,9 @@ +# EventSourceConfig + +**Properties** + +| Name | Type | Required | Description | +| :----- | :---------------------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.EventSourceConfigPayload](event_source_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/event_source_config_collection.md b/docs/project-client/models/event_source_config_collection.md new file mode 100644 index 0000000..e284a90 --- /dev/null +++ b/docs/project-client/models/event_source_config_collection.md @@ -0,0 +1,8 @@ +# EventSourceConfigCollection + +**Properties** + +| Name | Type | Required | Description | +| :---- | :--------------------------------------------------------- | :------- | :---------- | +| Data | [][integrations.EventSourceConfig](event_source_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/event_source_config_payload.md b/docs/project-client/models/event_source_config_payload.md new file mode 100644 index 0000000..72903e7 --- /dev/null +++ b/docs/project-client/models/event_source_config_payload.md @@ -0,0 +1,7 @@ +# EventSourceConfigPayload + +**Properties** + +| Name | Type | Required | Description | +| :----- | :----- | :------- | :---------- | +| Source | string | ✅ | | diff --git a/docs/project-client/models/execute_workflow_request.md b/docs/project-client/models/execute_workflow_request.md new file mode 100644 index 0000000..e4e382a --- /dev/null +++ b/docs/project-client/models/execute_workflow_request.md @@ -0,0 +1,8 @@ +# ExecuteWorkflowRequest + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :---------- | +| Key | string | ✅ | | +| Input | any | ❌ | | diff --git a/docs/project-client/models/expo_config.md b/docs/project-client/models/expo_config.md index 3ed714b..1734dbf 100644 --- a/docs/project-client/models/expo_config.md +++ b/docs/project-client/models/expo_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :----------------------------- | :------- | :---------- | -| Config | integrations.ExpoConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.ExpoConfigPayload](expo_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/expo_config_collection.md b/docs/project-client/models/expo_config_collection.md index 18529ee..36f6b88 100644 --- a/docs/project-client/models/expo_config_collection.md +++ b/docs/project-client/models/expo_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------ | :------- | :---------- | -| Data | []integrations.ExpoConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------ | :------- | :---------- | +| Data | [][integrations.ExpoConfig](expo_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/expo_token_collection.md b/docs/project-client/models/expo_token_collection.md index 016b17e..86aa56b 100644 --- a/docs/project-client/models/expo_token_collection.md +++ b/docs/project-client/models/expo_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------- | :------- | :---------- | -| Data | []channels.ExpoToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------ | :------- | :---------- | +| Data | [][channels.ExpoToken](expo_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/fcm_config.md b/docs/project-client/models/fcm_config.md index 7c33824..dcf8079 100644 --- a/docs/project-client/models/fcm_config.md +++ b/docs/project-client/models/fcm_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :---------------------------- | :------- | :---------- | -| Config | integrations.FcmConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :----------------------------------------------------- | :------- | :---------- | +| Config | [integrations.FcmConfigPayload](fcm_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/fcm_config_collection.md b/docs/project-client/models/fcm_config_collection.md index 1cdb186..8339d37 100644 --- a/docs/project-client/models/fcm_config_collection.md +++ b/docs/project-client/models/fcm_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :----------------------- | :------- | :---------- | -| Data | []integrations.FcmConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------------- | :------- | :---------- | +| Data | [][integrations.FcmConfig](fcm_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/fcm_config_payload.md b/docs/project-client/models/fcm_config_payload.md index 2ff975f..e559a3f 100644 --- a/docs/project-client/models/fcm_config_payload.md +++ b/docs/project-client/models/fcm_config_payload.md @@ -20,6 +20,6 @@ **Properties** -| Name | Type | Required | Description | -| :-------------- | :----- | :------- | :---------------- | -| service_account | string | ✅ | "service_account" | +| Name | Type | Required | Description | +| :------------- | :----- | :------- | :---------------- | +| ServiceAccount | string | ✅ | "service_account" | diff --git a/docs/project-client/models/fcm_token.md b/docs/project-client/models/fcm_token.md index 159a1df..e5f4d96 100644 --- a/docs/project-client/models/fcm_token.md +++ b/docs/project-client/models/fcm_token.md @@ -17,5 +17,5 @@ | Name | Type | Required | Description | | :---------- | :----- | :------- | :------------ | -| development | string | ✅ | "development" | -| production | string | ✅ | "production" | +| Development | string | ✅ | "development" | +| Production | string | ✅ | "production" | diff --git a/docs/project-client/models/fcm_token_collection.md b/docs/project-client/models/fcm_token_collection.md index 234da3f..0a2f5cd 100644 --- a/docs/project-client/models/fcm_token_collection.md +++ b/docs/project-client/models/fcm_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------ | :------- | :---------- | -| Data | []channels.FcmToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------- | :------- | :---------- | +| Data | [][channels.FcmToken](fcm_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/get_run_response.md b/docs/project-client/models/get_run_response.md new file mode 100644 index 0000000..c3bba52 --- /dev/null +++ b/docs/project-client/models/get_run_response.md @@ -0,0 +1,22 @@ +# GetRunResponse + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----------------------------- | :------- | :---------- | +| CreatedAt | string | ❌ | | +| Id | string | ❌ | | +| Status | workflows.GetRunResponseStatus | ❌ | | +| WorkflowKey | string | ❌ | | + +# GetRunResponseStatus + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----- | :------- | :---------- | +| CompletedAt | string | ❌ | | +| Error | string | ❌ | | +| NextStep | int64 | ❌ | | +| StartedAt | string | ❌ | | +| State | int64 | ❌ | | diff --git a/docs/project-client/models/github_config.md b/docs/project-client/models/github_config.md index 0842ce4..1e0b87e 100644 --- a/docs/project-client/models/github_config.md +++ b/docs/project-client/models/github_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :------------------------------- | :------- | :---------- | -| Config | integrations.GithubConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :----------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.GithubConfigPayload](github_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/github_config_collection.md b/docs/project-client/models/github_config_collection.md index f26dd75..b2e0a15 100644 --- a/docs/project-client/models/github_config_collection.md +++ b/docs/project-client/models/github_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------------- | :------- | :---------- | -| Data | []integrations.GithubConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------------------- | :------- | :---------- | +| Data | [][integrations.GithubConfig](github_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/inbox_config.md b/docs/project-client/models/inbox_config.md index 9c82ea2..262e5d9 100644 --- a/docs/project-client/models/inbox_config.md +++ b/docs/project-client/models/inbox_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :------------------------------ | :------- | :---------- | -| Config | integrations.InboxConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :--------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.InboxConfigPayload](inbox_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/inbox_config_collection.md b/docs/project-client/models/inbox_config_collection.md index eb1cac9..0010d65 100644 --- a/docs/project-client/models/inbox_config_collection.md +++ b/docs/project-client/models/inbox_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------- | :------- | :---------- | -| Data | []integrations.InboxConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------- | :------- | :---------- | +| Data | [][integrations.InboxConfig](inbox_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/inbox_token_response_collection.md b/docs/project-client/models/inbox_token_response_collection.md index b3bb125..cf5a84b 100644 --- a/docs/project-client/models/inbox_token_response_collection.md +++ b/docs/project-client/models/inbox_token_response_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :---------------------------- | :------- | :---------- | -| Data | []channels.InboxTokenResponse | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------------------- | :------- | :---------- | +| Data | [][channels.InboxTokenResponse](inbox_token_response.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/integration_config_collection.md b/docs/project-client/models/integration_config_collection.md index 468c7e1..8c9c3ea 100644 --- a/docs/project-client/models/integration_config_collection.md +++ b/docs/project-client/models/integration_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------------- | :------- | :---------- | -| Data | []integrations.IntegrationConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------------------- | :------- | :---------- | +| Data | [][integrations.IntegrationConfig](integration_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/mailgun_config.md b/docs/project-client/models/mailgun_config.md index 8506728..db83965 100644 --- a/docs/project-client/models/mailgun_config.md +++ b/docs/project-client/models/mailgun_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :-------------------------------- | :------- | :---------- | -| Config | integrations.MailgunConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :------------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.MailgunConfigPayload](mailgun_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/mailgun_config_collection.md b/docs/project-client/models/mailgun_config_collection.md index 6211312..a136614 100644 --- a/docs/project-client/models/mailgun_config_collection.md +++ b/docs/project-client/models/mailgun_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :--------------------------- | :------- | :---------- | -| Data | []integrations.MailgunConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------------ | :------- | :---------- | +| Data | [][integrations.MailgunConfig](mailgun_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/mailgun_config_payload.md b/docs/project-client/models/mailgun_config_payload.md index f8903a7..e677638 100644 --- a/docs/project-client/models/mailgun_config_payload.md +++ b/docs/project-client/models/mailgun_config_payload.md @@ -15,8 +15,8 @@ | Name | Type | Required | Description | | :--- | :----- | :------- | :---------- | -| us | string | ✅ | "us" | -| eu | string | ✅ | "eu" | +| Us | string | ✅ | "us" | +| Eu | string | ✅ | "eu" | # MailgunConfigPayloadFrom diff --git a/docs/project-client/models/ping_config.md b/docs/project-client/models/ping_config.md index 1c71512..8ecd492 100644 --- a/docs/project-client/models/ping_config.md +++ b/docs/project-client/models/ping_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :----------------------------- | :------- | :---------- | -| Config | integrations.PingConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.PingConfigPayload](ping_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/ping_config_collection.md b/docs/project-client/models/ping_config_collection.md index 25f9da6..61eff6d 100644 --- a/docs/project-client/models/ping_config_collection.md +++ b/docs/project-client/models/ping_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------ | :------- | :---------- | -| Data | []integrations.PingConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------ | :------- | :---------- | +| Data | [][integrations.PingConfig](ping_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/sendgrid_config.md b/docs/project-client/models/sendgrid_config.md index 6d5a38e..205728a 100644 --- a/docs/project-client/models/sendgrid_config.md +++ b/docs/project-client/models/sendgrid_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :--------------------------------- | :------- | :---------- | -| Config | integrations.SendgridConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :--------------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.SendgridConfigPayload](sendgrid_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/sendgrid_config_collection.md b/docs/project-client/models/sendgrid_config_collection.md index 0fb76c8..6ef3a10 100644 --- a/docs/project-client/models/sendgrid_config_collection.md +++ b/docs/project-client/models/sendgrid_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :---------------------------- | :------- | :---------- | -| Data | []integrations.SendgridConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------------- | :------- | :---------- | +| Data | [][integrations.SendgridConfig](sendgrid_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/sendgrid_config_payload.md b/docs/project-client/models/sendgrid_config_payload.md index 2edac0c..fa941c5 100644 --- a/docs/project-client/models/sendgrid_config_payload.md +++ b/docs/project-client/models/sendgrid_config_payload.md @@ -2,11 +2,11 @@ **Properties** -| Name | Type | Required | Description | -| :------ | :------------------------------------- | :------- | :----------------------- | -| ApiKey | string | ✅ | The API key for Sendgrid | -| From | integrations.SendgridConfigPayloadFrom | ❌ | | -| ReplyTo | integrations.ReplyTo | ❌ | | +| Name | Type | Required | Description | +| :------ | :---------------------------------------- | :------- | :----------------------- | +| ApiKey | string | ✅ | The API key for Sendgrid | +| From | integrations.SendgridConfigPayloadFrom | ❌ | | +| ReplyTo | integrations.SendgridConfigPayloadReplyTo | ❌ | | # SendgridConfigPayloadFrom @@ -17,7 +17,7 @@ | Email | string | ✅ | The email address to send from | | Name | string | ❌ | The name to send from | -# ReplyTo +# SendgridConfigPayloadReplyTo **Properties** diff --git a/docs/project-client/models/ses_config.md b/docs/project-client/models/ses_config.md index 87ae51e..80ba9e5 100644 --- a/docs/project-client/models/ses_config.md +++ b/docs/project-client/models/ses_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :---------------------------- | :------- | :---------- | -| Config | integrations.SesConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :----------------------------------------------------- | :------- | :---------- | +| Config | [integrations.SesConfigPayload](ses_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/ses_config_collection.md b/docs/project-client/models/ses_config_collection.md index 29cb80a..a3d181d 100644 --- a/docs/project-client/models/ses_config_collection.md +++ b/docs/project-client/models/ses_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :----------------------- | :------- | :---------- | -| Data | []integrations.SesConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------------- | :------- | :---------- | +| Data | [][integrations.SesConfig](ses_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/slack_config.md b/docs/project-client/models/slack_config.md index bdd750f..b7598e9 100644 --- a/docs/project-client/models/slack_config.md +++ b/docs/project-client/models/slack_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :------------------------------ | :------- | :---------- | -| Config | integrations.SlackConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :--------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.SlackConfigPayload](slack_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/slack_config_collection.md b/docs/project-client/models/slack_config_collection.md index df24a5e..0519726 100644 --- a/docs/project-client/models/slack_config_collection.md +++ b/docs/project-client/models/slack_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------- | :------- | :---------- | -| Data | []integrations.SlackConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------- | :------- | :---------- | +| Data | [][integrations.SlackConfig](slack_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/slack_token_collection.md b/docs/project-client/models/slack_token_collection.md index f8d5581..cb50f05 100644 --- a/docs/project-client/models/slack_token_collection.md +++ b/docs/project-client/models/slack_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------- | :------- | :---------- | -| Data | []channels.SlackToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------- | :------- | :---------- | +| Data | [][channels.SlackToken](slack_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/smtp_config.md b/docs/project-client/models/smtp_config.md new file mode 100644 index 0000000..6cee728 --- /dev/null +++ b/docs/project-client/models/smtp_config.md @@ -0,0 +1,47 @@ +# SmtpConfig + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----------------------------- | :------- | :------------------------------ | +| From | integrations.SmtpConfigFrom | ✅ | Default sender email address | +| Host | string | ✅ | SMTP server hostname | +| Password | string | ✅ | SMTP authentication password | +| Port | int64 | ✅ | SMTP server port | +| Username | string | ✅ | SMTP authentication username | +| ReplyTo | integrations.SmtpConfigReplyTo | ❌ | Reply-to email address | +| Security | integrations.Security | ❌ | SMTP security/encryption method | + +# SmtpConfigFrom + +Default sender email address + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :------------------- | +| Email | string | ✅ | Sender email address | +| Name | string | ❌ | Sender name | + +# SmtpConfigReplyTo + +Reply-to email address + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----- | :------- | :--------------------- | +| Email | string | ✅ | Reply-to email address | +| Name | string | ❌ | Reply-to name | + +# Security + +SMTP security/encryption method + +**Properties** + +| Name | Type | Required | Description | +| :------- | :----- | :------- | :---------- | +| None | string | ✅ | "none" | +| Ssl | string | ✅ | "ssl" | +| Starttls | string | ✅ | "starttls" | diff --git a/docs/project-client/models/smtp_config_object.md b/docs/project-client/models/smtp_config_object.md new file mode 100644 index 0000000..f2138c2 --- /dev/null +++ b/docs/project-client/models/smtp_config_object.md @@ -0,0 +1,9 @@ +# SmtpConfigObject + +**Properties** + +| Name | Type | Required | Description | +| :----- | :---------------------------------------- | :------- | :---------- | +| Config | [integrations.SmtpConfig](smtp_config.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/smtp_config_object_collection.md b/docs/project-client/models/smtp_config_object_collection.md new file mode 100644 index 0000000..091d79b --- /dev/null +++ b/docs/project-client/models/smtp_config_object_collection.md @@ -0,0 +1,8 @@ +# SmtpConfigObjectCollection + +**Properties** + +| Name | Type | Required | Description | +| :---- | :------------------------------------------------------- | :------- | :---------- | +| Data | [][integrations.SmtpConfigObject](smtp_config_object.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/stripe_config.md b/docs/project-client/models/stripe_config.md index 358331b..a46adb6 100644 --- a/docs/project-client/models/stripe_config.md +++ b/docs/project-client/models/stripe_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :------------------------------- | :------- | :---------- | -| Config | integrations.StripeConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :----------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.StripeConfigPayload](stripe_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/stripe_config_collection.md b/docs/project-client/models/stripe_config_collection.md index f9d9656..a88a801 100644 --- a/docs/project-client/models/stripe_config_collection.md +++ b/docs/project-client/models/stripe_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------------- | :------- | :---------- | -| Data | []integrations.StripeConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------------------- | :------- | :---------- | +| Data | [][integrations.StripeConfig](stripe_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/stripe_config_payload.md b/docs/project-client/models/stripe_config_payload.md index 1647ad0..a06ca15 100644 --- a/docs/project-client/models/stripe_config_payload.md +++ b/docs/project-client/models/stripe_config_payload.md @@ -5,3 +5,4 @@ | Name | Type | Required | Description | | :------------------- | :----- | :------- | :--------------------------------------------------------- | | WebhookSigningSecret | string | ✅ | The signing secret to verify incoming requests from Stripe | +| Id | string | ❌ | The unique identifier for this configuration | diff --git a/docs/project-client/models/teams_token_collection.md b/docs/project-client/models/teams_token_collection.md index 1ca3537..b837dca 100644 --- a/docs/project-client/models/teams_token_collection.md +++ b/docs/project-client/models/teams_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------- | :------- | :---------- | -| Data | []channels.TeamsToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------- | :------- | :---------- | +| Data | [][channels.TeamsToken](teams_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/twilio_config.md b/docs/project-client/models/twilio_config.md index 173deed..76d0797 100644 --- a/docs/project-client/models/twilio_config.md +++ b/docs/project-client/models/twilio_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :------------------------------- | :------- | :---------- | -| Config | integrations.TwilioConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :----------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.TwilioConfigPayload](twilio_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/twilio_config_collection.md b/docs/project-client/models/twilio_config_collection.md index 579e6a6..bfb8a6f 100644 --- a/docs/project-client/models/twilio_config_collection.md +++ b/docs/project-client/models/twilio_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------------- | :------- | :---------- | -| Data | []integrations.TwilioConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------------------- | :------- | :---------- | +| Data | [][integrations.TwilioConfig](twilio_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/user_collection.md b/docs/project-client/models/user_collection.md index f95ebf2..042a778 100644 --- a/docs/project-client/models/user_collection.md +++ b/docs/project-client/models/user_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------ | :------- | :---------- | -| Data | []shared.User | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :----------------------- | :------- | :---------- | +| Data | [][shared.User](user.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/web_push_token_collection.md b/docs/project-client/models/web_push_token_collection.md index ed16554..6446fe5 100644 --- a/docs/project-client/models/web_push_token_collection.md +++ b/docs/project-client/models/web_push_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :---------------------- | :------- | :---------- | -| Data | []channels.WebPushToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------- | :------- | :---------- | +| Data | [][channels.WebPushToken](web_push_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/webpush_config.md b/docs/project-client/models/webpush_config.md index 1feede3..d62ace0 100644 --- a/docs/project-client/models/webpush_config.md +++ b/docs/project-client/models/webpush_config.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :-------------------------------- | :------- | :---------- | -| Config | integrations.WebpushConfigPayload | ✅ | | -| Id | string | ✅ | | -| Name | string | ✅ | | +| Name | Type | Required | Description | +| :----- | :------------------------------------------------------------- | :------- | :---------- | +| Config | [integrations.WebpushConfigPayload](webpush_config_payload.md) | ✅ | | +| Id | string | ✅ | | +| Name | string | ✅ | | diff --git a/docs/project-client/models/webpush_config_collection.md b/docs/project-client/models/webpush_config_collection.md index b149f5a..542b849 100644 --- a/docs/project-client/models/webpush_config_collection.md +++ b/docs/project-client/models/webpush_config_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :--------------------------- | :------- | :---------- | -| Data | []integrations.WebpushConfig | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------------ | :------- | :---------- | +| Data | [][integrations.WebpushConfig](webpush_config.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/models/webpush_config_payload.md b/docs/project-client/models/webpush_config_payload.md index 00270b8..3e61859 100644 --- a/docs/project-client/models/webpush_config_payload.md +++ b/docs/project-client/models/webpush_config_payload.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :--------- | :----- | :------- | :------------------------------------------------------------------- | -| PrivateKey | string | ✅ | VAPID private key - from the pair you generated. | -| PublicKey | string | ✅ | VAPID public key - generate one at https://tools.reactpwa.com/vapid. | +| Name | Type | Required | Description | +| :--------- | :----- | :------- | :---------------------------------------------------------------------------- | +| PrivateKey | string | ✅ | VAPID private key - from the pair you generated. | +| PublicKey | string | ✅ | VAPID public key - generate one at https://magicbell.com/web-push/vapid-keys. | diff --git a/docs/project-client/models/workflow_definition.md b/docs/project-client/models/workflow_definition.md new file mode 100644 index 0000000..1b39d50 --- /dev/null +++ b/docs/project-client/models/workflow_definition.md @@ -0,0 +1,19 @@ +# WorkflowDefinition + +**Properties** + +| Name | Type | Required | Description | +| :------- | :---------------- | :------- | :---------- | +| Key | string | ✅ | | +| Steps | []workflows.Steps | ✅ | | +| Disabled | bool | ❌ | | + +# Steps + +**Properties** + +| Name | Type | Required | Description | +| :------ | :----- | :------- | :---------- | +| Command | string | ✅ | | +| If\_ | string | ❌ | | +| Input | any | ❌ | | diff --git a/docs/project-client/models/workflow_run.md b/docs/project-client/models/workflow_run.md new file mode 100644 index 0000000..16ea66a --- /dev/null +++ b/docs/project-client/models/workflow_run.md @@ -0,0 +1,22 @@ +# WorkflowRun + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :-------------------------- | :------- | :---------- | +| CreatedAt | string | ❌ | | +| Id | string | ❌ | | +| Status | workflows.WorkflowRunStatus | ❌ | | +| WorkflowKey | string | ❌ | | + +# WorkflowRunStatus + +**Properties** + +| Name | Type | Required | Description | +| :---------- | :----- | :------- | :---------- | +| CompletedAt | string | ❌ | | +| Error | string | ❌ | | +| NextStep | int64 | ❌ | | +| StartedAt | string | ❌ | | +| State | int64 | ❌ | | diff --git a/docs/project-client/models/workflow_run_collection.md b/docs/project-client/models/workflow_run_collection.md new file mode 100644 index 0000000..bb85e68 --- /dev/null +++ b/docs/project-client/models/workflow_run_collection.md @@ -0,0 +1,8 @@ +# WorkflowRunCollection + +**Properties** + +| Name | Type | Required | Description | +| :---- | :----------------------------------------- | :------- | :---------- | +| Data | [][workflows.WorkflowRun](workflow_run.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/project-client/services/broadcasts_service.md b/docs/project-client/services/broadcasts_service.md index def4ef7..655ccab 100644 --- a/docs/project-client/services/broadcasts_service.md +++ b/docs/project-client/services/broadcasts_service.md @@ -32,18 +32,22 @@ Retrieves a paginated list of broadcasts for the project. Returns basic informat import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/broadcasts" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := broadcasts.ListBroadcastsRequestParams{ - + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Broadcasts.ListBroadcasts(context.Background(), params) @@ -78,6 +82,7 @@ Creates a new broadcast. When a broadcast is created, it generates individual no import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -85,34 +90,35 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) email := broadcasts.Email{ - ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }), - Content: util.ToPointer("Content"), - Title: util.ToPointer("Title"), + ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "action_url" }), + Content: util.ToPointer("content"), + Title: util.ToPointer("title"), } inApp := broadcasts.InApp{ - ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }), - Content: util.ToPointer("Content"), - Title: util.ToPointer("Title"), + ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "action_url" }), + Content: util.ToPointer("content"), + Title: util.ToPointer("title"), } mobilePush := broadcasts.MobilePush{ - ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }), - Content: util.ToPointer("Content"), - Title: util.ToPointer("Title"), + ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "action_url" }), + Content: util.ToPointer("content"), + Title: util.ToPointer("title"), } sms := broadcasts.Sms{ - ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }), - Content: util.ToPointer("Content"), - Title: util.ToPointer("Title"), + ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "action_url" }), + Content: util.ToPointer("content"), + Title: util.ToPointer("title"), } overridesChannels := broadcasts.OverridesChannels{ @@ -143,29 +149,29 @@ overrides := broadcasts.Overrides{ user := shared.User{ - CreatedAt: util.ToPointer(util.Nullable[string]{ Value: "CreatedAt" }), + CreatedAt: util.ToPointer(util.Nullable[string]{ Value: "created_at" }), CustomAttributes: []byte{}, - Email: util.ToPointer(util.Nullable[string]{ Value: "Email" }), - ExternalId: util.ToPointer(util.Nullable[string]{ Value: "ExternalId" }), - FirstName: util.ToPointer(util.Nullable[string]{ Value: "FirstName" }), - Id: util.ToPointer("Id"), - LastName: util.ToPointer(util.Nullable[string]{ Value: "LastName" }), - LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: "LastNotifiedAt" }), - LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: "LastSeenAt" }), - UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: "UpdatedAt" }), + Email: util.ToPointer(util.Nullable[string]{ Value: "email" }), + ExternalId: util.ToPointer(util.Nullable[string]{ Value: "external_id" }), + FirstName: util.ToPointer(util.Nullable[string]{ Value: "first_name" }), + Id: util.ToPointer("id"), + LastName: util.ToPointer(util.Nullable[string]{ Value: "last_name" }), + LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: "last_notified_at" }), + LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: "last_seen_at" }), + UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: "updated_at" }), } errors := broadcasts.Errors{ - Message: util.ToPointer("Message"), + Message: util.ToPointer("message"), } statusStatus := broadcasts.STATUS_STATUS_ENQUEUED summary := broadcasts.Summary{ - Failures: util.ToPointer(int64(123)), - Total: util.ToPointer(int64(123)), + Failures: util.ToPointer(int64(8)), + Total: util.ToPointer(int64(1)), } broadcastStatus := broadcasts.BroadcastStatus{ @@ -175,17 +181,17 @@ broadcastStatus := broadcasts.BroadcastStatus{ } request := broadcasts.Broadcast{ - ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }), - Category: util.ToPointer(util.Nullable[string]{ Value: "Category" }), - Content: util.ToPointer(util.Nullable[string]{ Value: "Content" }), - CreatedAt: util.ToPointer("CreatedAt"), + ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "action_url" }), + Category: util.ToPointer(util.Nullable[string]{ Value: "category" }), + Content: util.ToPointer(util.Nullable[string]{ Value: "content" }), + CreatedAt: util.ToPointer("created_at"), CustomAttributes: []byte{}, - Id: util.ToPointer("Id"), + Id: util.ToPointer("id"), Overrides: &overrides, Recipients: []shared.User{user}, Status: &broadcastStatus, - Title: util.ToPointer("Title"), - Topic: util.ToPointer(util.Nullable[string]{ Value: "Topic" }), + Title: util.ToPointer("title"), + Topic: util.ToPointer(util.Nullable[string]{ Value: "topic" }), } response, err := client.Broadcasts.CreateBroadcast(context.Background(), request) @@ -220,15 +226,17 @@ Retrieves detailed information about a specific broadcast by its ID. Includes th import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Broadcasts.FetchBroadcast(context.Background(), "broadcastId") +response, err := client.Broadcasts.FetchBroadcast(context.Background(), "broadcast_id") if err != nil { panic(err) } diff --git a/docs/project-client/services/channels_service.md b/docs/project-client/services/channels_service.md index c49d966..17ba02d 100644 --- a/docs/project-client/services/channels_service.md +++ b/docs/project-client/services/channels_service.md @@ -52,6 +52,7 @@ Save the channels configuration for a given key. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -59,20 +60,21 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) channel := channels.CHANNEL_IN_APP categoryDeliveryConfigChannels := channels.CategoryDeliveryConfigChannels{ Channel: &channel, - Delay: util.ToPointer(int64(123)), - If_: util.ToPointer(util.Nullable[string]{ Value: "If_" }), + Delay: util.ToPointer(int64(5)), + If_: util.ToPointer(util.Nullable[string]{ Value: "if" }), } request := channels.CategoryDeliveryConfig{ Channels: []channels.CategoryDeliveryConfigChannels{categoryDeliveryConfigChannels}, Disabled: util.ToPointer(true), - Key: util.ToPointer("Key"), + Key: util.ToPointer("key"), } response, err := client.Channels.SaveChannelsConfig(context.Background(), request) @@ -107,12 +109,14 @@ Fetches the channels config for a given key. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Channels.FetchChannelsConfig(context.Background(), "key") @@ -148,21 +152,25 @@ Lists all Inbox tokens associated with a specific user. This endpoint is availab import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserInboxTokensRequestParams{ - + Limit: util.ToPointer(int64(4)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserInboxTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserInboxTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -195,15 +203,17 @@ Fetches a specific Inbox token by its ID for a given user. This endpoint is avai import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserInboxToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserInboxToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -236,15 +246,17 @@ Deletes a specific user's Inbox token. This endpoint is available to project adm import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserInboxToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserInboxToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -277,21 +289,25 @@ Lists all APNs tokens associated with a specific user. This endpoint is availabl import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserApnsTokensRequestParams{ - + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserApnsTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserApnsTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -324,15 +340,17 @@ Fetches a specific APNs token by its ID for a given user. This endpoint is avail import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserApnsToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserApnsToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -365,15 +383,17 @@ Deletes a specific user's APNs token. This endpoint is available to project admi import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserApnsToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserApnsToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -406,21 +426,25 @@ Lists all Expo tokens associated with a specific user. This endpoint is availabl import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserExpoTokensRequestParams{ - + Limit: util.ToPointer(int64(2)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserExpoTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserExpoTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -453,15 +477,17 @@ Fetches a specific Expo token by its ID for a given user. This endpoint is avail import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserExpoToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserExpoToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -494,15 +520,17 @@ Deletes a specific user's Expo token. This endpoint is available to project admi import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserExpoToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserExpoToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -535,21 +563,25 @@ Lists all FCM tokens associated with a specific user. This endpoint is available import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserFcmTokensRequestParams{ - + Limit: util.ToPointer(int64(1)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserFcmTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserFcmTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -582,15 +614,17 @@ Fetches a specific FCM token by its ID for a given user. This endpoint is availa import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserFcmToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserFcmToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -623,15 +657,17 @@ Deletes a specific user's FCM token. This endpoint is available to project admin import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserFcmToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserFcmToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -664,21 +700,25 @@ Lists all Slack tokens associated with a specific user. This endpoint is availab import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserSlackTokensRequestParams{ - + Limit: util.ToPointer(int64(7)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserSlackTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserSlackTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -711,15 +751,17 @@ Fetches a specific Slack token by its ID for a given user. This endpoint is avai import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserSlackToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserSlackToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -752,15 +794,17 @@ Deletes a specific user's Slack token. This endpoint is available to project adm import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserSlackToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserSlackToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -793,21 +837,25 @@ Lists all Teams tokens associated with a specific user. This endpoint is availab import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserTeamsTokensRequestParams{ - + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserTeamsTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserTeamsTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -840,15 +888,17 @@ Fetches a specific Teams token by its ID for a given user. This endpoint is avai import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserTeamsToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserTeamsToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -881,15 +931,17 @@ Deletes a specific user's Teams token. This endpoint is available to project adm import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserTeamsToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserTeamsToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -922,21 +974,25 @@ Lists all Web Push tokens associated with a specific user. This endpoint is avai import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListUserWebPushTokensRequestParams{ - + Limit: util.ToPointer(int64(3)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } -response, err := client.Channels.ListUserWebPushTokens(context.Background(), "userId", params) +response, err := client.Channels.ListUserWebPushTokens(context.Background(), "user_id", params) if err != nil { panic(err) } @@ -969,15 +1025,17 @@ Fetches a specific Web Push token by its ID for a given user. This endpoint is a import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchUserWebPushToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.FetchUserWebPushToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } @@ -1010,15 +1068,17 @@ Deletes a specific user's Web Push token. This endpoint is available to project import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteUserWebPushToken(context.Background(), "userId", "tokenId") +response, err := client.Channels.DeleteUserWebPushToken(context.Background(), "user_id", "token_id") if err != nil { panic(err) } diff --git a/docs/project-client/services/events_service.md b/docs/project-client/services/events_service.md index bb2ba10..7e58df6 100644 --- a/docs/project-client/services/events_service.md +++ b/docs/project-client/services/events_service.md @@ -31,18 +31,22 @@ Retrieves a paginated list of events for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/events" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := events.ListEventsRequestParams{ - + Limit: util.ToPointer(int64(3)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Events.ListEvents(context.Background(), params) @@ -77,15 +81,17 @@ Fetches a project event by its ID. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Events.FetchEvent(context.Background(), "eventId") +response, err := client.Events.FetchEvent(context.Background(), "event_id") if err != nil { panic(err) } diff --git a/docs/project-client/services/integrations_service.md b/docs/project-client/services/integrations_service.md index 333d044..afcbf31 100644 --- a/docs/project-client/services/integrations_service.md +++ b/docs/project-client/services/integrations_service.md @@ -2,48 +2,54 @@ A list of all methods in the `IntegrationsService` service. Click on the method name to view detailed information about that method. -| Methods | Description | -| :-------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [ListIntegrations](#listintegrations) | Lists all available and configured integrations for the project. Returns a summary of each integration including its type, status, and basic configuration information. | -| [ListApnsIntegrations](#listapnsintegrations) | Retrieves the current APNs integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveApnsIntegration](#saveapnsintegration) | Updates or creates the APNs integration for the project. | -| [DeleteApnsIntegration](#deleteapnsintegration) | Deletes the APNs integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListExpoIntegrations](#listexpointegrations) | Retrieves the current Expo integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveExpoIntegration](#saveexpointegration) | Updates or creates the Expo integration for the project. | -| [DeleteExpoIntegration](#deleteexpointegration) | Deletes the Expo integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListFcmIntegrations](#listfcmintegrations) | Retrieves the current FCM integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveFcmIntegration](#savefcmintegration) | Updates or creates the FCM integration for the project. | -| [DeleteFcmIntegration](#deletefcmintegration) | Deletes the FCM integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListGithubIntegrations](#listgithubintegrations) | Retrieves the current GitHub integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveGithubIntegration](#savegithubintegration) | Updates or creates the GitHub integration for the project. | -| [DeleteGithubIntegration](#deletegithubintegration) | Deletes the GitHub integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListInboxIntegrations](#listinboxintegrations) | Retrieves the current Inbox integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveInboxIntegration](#saveinboxintegration) | Updates or creates the Inbox integration for the project. | -| [DeleteInboxIntegration](#deleteinboxintegration) | Deletes the Inbox integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListMailgunIntegrations](#listmailgunintegrations) | Retrieves the current Mailgun integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveMailgunIntegration](#savemailgunintegration) | Updates or creates the Mailgun integration for the project. | -| [DeleteMailgunIntegration](#deletemailgunintegration) | Deletes the Mailgun integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListPingEmailIntegrations](#listpingemailintegrations) | Retrieves the current Ping Email integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SavePingEmailIntegration](#savepingemailintegration) | Updates or creates the Ping Email integration for the project. | -| [DeletePingEmailIntegration](#deletepingemailintegration) | Deletes the Ping Email integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListSendgridIntegrations](#listsendgridintegrations) | Retrieves the current SendGrid integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveSendgridIntegration](#savesendgridintegration) | Updates or creates the SendGrid integration for the project. | -| [DeleteSendgridIntegration](#deletesendgridintegration) | Deletes the SendGrid integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListSesIntegrations](#listsesintegrations) | Retrieves the current Amazon SES integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveSesIntegration](#savesesintegration) | Updates or creates the Amazon SES integration for the project. | -| [DeleteSesIntegration](#deletesesintegration) | Deletes the Amazon SES integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListSlackIntegrations](#listslackintegrations) | Retrieves the current Slack integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveSlackIntegration](#saveslackintegration) | Updates or creates the Slack integration for the project. | -| [DeleteSlackIntegration](#deleteslackintegration) | Deletes the Slack integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListStripeIntegrations](#liststripeintegrations) | Retrieves the current Stripe integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveStripeIntegration](#savestripeintegration) | Updates or creates the Stripe integration for the project. | -| [DeleteStripeIntegration](#deletestripeintegration) | Deletes the Stripe integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListTwilioIntegrations](#listtwiliointegrations) | Retrieves the current Twilio integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveTwilioIntegration](#savetwiliointegration) | Updates or creates the Twilio integration for the project. | -| [DeleteTwilioIntegration](#deletetwiliointegration) | Deletes the Twilio integration configuration from the project. This will disable the integration's functionality within the project. | -| [ListWebPushIntegrations](#listwebpushintegrations) | Retrieves the current Web Push integration configurations for a specific integration type in the project. Returns configuration details and status information. | -| [SaveWebPushIntegration](#savewebpushintegration) | Updates or creates the Web Push integration for the project. | -| [DeleteWebPushIntegration](#deletewebpushintegration) | Deletes the Web Push integration configuration from the project. This will disable the integration's functionality within the project. | +| Methods | Description | +| :------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [ListIntegrations](#listintegrations) | Lists all available and configured integrations for the project. Returns a summary of each integration including its type, status, and basic configuration information. | +| [ListApnsIntegrations](#listapnsintegrations) | Retrieves the current APNs integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveApnsIntegration](#saveapnsintegration) | Updates or creates the APNs integration for the project. | +| [DeleteApnsIntegration](#deleteapnsintegration) | Deletes the APNs integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListEventsourceIntegrations](#listeventsourceintegrations) | Retrieves the current EventSource integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveEventsourceIntegration](#saveeventsourceintegration) | Updates or creates the EventSource integration for the project. | +| [DeleteEventsourceIntegration](#deleteeventsourceintegration) | Deletes the EventSource integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListExpoIntegrations](#listexpointegrations) | Retrieves the current Expo integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveExpoIntegration](#saveexpointegration) | Updates or creates the Expo integration for the project. | +| [DeleteExpoIntegration](#deleteexpointegration) | Deletes the Expo integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListFcmIntegrations](#listfcmintegrations) | Retrieves the current FCM integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveFcmIntegration](#savefcmintegration) | Updates or creates the FCM integration for the project. | +| [DeleteFcmIntegration](#deletefcmintegration) | Deletes the FCM integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListGithubIntegrations](#listgithubintegrations) | Retrieves the current GitHub integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveGithubIntegration](#savegithubintegration) | Updates or creates the GitHub integration for the project. | +| [DeleteGithubIntegration](#deletegithubintegration) | Deletes the GitHub integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListInboxIntegrations](#listinboxintegrations) | Retrieves the current Inbox integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveInboxIntegration](#saveinboxintegration) | Updates or creates the Inbox integration for the project. | +| [DeleteInboxIntegration](#deleteinboxintegration) | Deletes the Inbox integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListMailgunIntegrations](#listmailgunintegrations) | Retrieves the current Mailgun integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveMailgunIntegration](#savemailgunintegration) | Updates or creates the Mailgun integration for the project. | +| [DeleteMailgunIntegration](#deletemailgunintegration) | Deletes the Mailgun integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListPingEmailIntegrations](#listpingemailintegrations) | Retrieves the current Ping Email integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SavePingEmailIntegration](#savepingemailintegration) | Updates or creates the Ping Email integration for the project. | +| [DeletePingEmailIntegration](#deletepingemailintegration) | Deletes the Ping Email integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListSendgridIntegrations](#listsendgridintegrations) | Retrieves the current SendGrid integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveSendgridIntegration](#savesendgridintegration) | Updates or creates the SendGrid integration for the project. | +| [DeleteSendgridIntegration](#deletesendgridintegration) | Deletes the SendGrid integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListSesIntegrations](#listsesintegrations) | Retrieves the current Amazon SES integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveSesIntegration](#savesesintegration) | Updates or creates the Amazon SES integration for the project. | +| [DeleteSesIntegration](#deletesesintegration) | Deletes the Amazon SES integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListSlackIntegrations](#listslackintegrations) | Retrieves the current Slack integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveSlackIntegration](#saveslackintegration) | Updates or creates the Slack integration for the project. | +| [DeleteSlackIntegration](#deleteslackintegration) | Deletes the Slack integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListSmtpIntegrations](#listsmtpintegrations) | Retrieves the current SMTP integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveSmtpIntegration](#savesmtpintegration) | Updates or creates the SMTP integration for the project. | +| [DeleteSmtpIntegration](#deletesmtpintegration) | Deletes the SMTP integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListStripeIntegrations](#liststripeintegrations) | Retrieves the current Stripe integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveStripeIntegration](#savestripeintegration) | Updates or creates the Stripe integration for the project. | +| [DeleteStripeIntegration](#deletestripeintegration) | Deletes the Stripe integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListTwilioIntegrations](#listtwiliointegrations) | Retrieves the current Twilio integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveTwilioIntegration](#savetwiliointegration) | Updates or creates the Twilio integration for the project. | +| [DeleteTwilioIntegration](#deletetwiliointegration) | Deletes the Twilio integration configuration from the project. This will disable the integration's functionality within the project. | +| [ListWebPushIntegrations](#listwebpushintegrations) | Retrieves the current Web Push integration configurations for a specific integration type in the project. Returns configuration details and status information. | +| [SaveWebPushIntegration](#savewebpushintegration) | Updates or creates the Web Push integration for the project. | +| [DeleteWebPushIntegration](#deletewebpushintegration) | Deletes the Web Push integration configuration from the project. This will disable the integration's functionality within the project. | ## ListIntegrations @@ -69,18 +75,22 @@ Lists all available and configured integrations for the project. Returns a summa import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.ListIntegrationsRequestParams{ - + Limit: util.ToPointer(int64(3)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Integrations.ListIntegrations(context.Background(), params) @@ -114,12 +124,14 @@ Retrieves the current APNs integration configurations for a specific integration import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListApnsIntegrations(context.Background()) @@ -154,6 +166,7 @@ Updates or creates the APNs integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -161,6 +174,7 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) badge := integrations.BADGE_UNREAD @@ -168,12 +182,14 @@ badge := integrations.BADGE_UNREAD payloadVersion := integrations.PAYLOAD_VERSION_1 request := integrations.ApnsConfigPayload{ - AppId: util.ToPointer("AppId"), + AppId: util.ToPointer("app_id"), Badge: &badge, - Certificate: util.ToPointer("Certificate"), - KeyId: util.ToPointer("KeyId"), + Certificate: util.ToPointer("----------- BEGIN PRIVATE KEY------ +m84591= +------- END PRIVATE KEYYYYYY-------"), + KeyId: util.ToPointer("sintdolor "), PayloadVersion: &payloadVersion, - TeamId: util.ToPointer("TeamId"), + TeamId: util.ToPointer("laborumiru"), } response, err := client.Integrations.SaveApnsIntegration(context.Background(), request) @@ -208,18 +224,20 @@ Deletes the APNs integration configuration from the project. This will disable t import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteApnsIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteApnsIntegration(context.Background(), params) @@ -230,6 +248,143 @@ if err != nil { fmt.Println(response) ``` +## ListEventsourceIntegrations + +Retrieves the current EventSource integration configurations for a specific integration type in the project. Returns configuration details and status information. + +- HTTP Method: `GET` +- Endpoint: `/integrations/eventsource` + +**Parameters** + +| Name | Type | Required | Description | +| :--- | :------ | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | + +**Return Type** + +`EventSourceConfigCollection` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + +response, err := client.Integrations.ListEventsourceIntegrations(context.Background()) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## SaveEventsourceIntegration + +Updates or creates the EventSource integration for the project. + +- HTTP Method: `PUT` +- Endpoint: `/integrations/eventsource` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------------- | :----------------------- | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| eventSourceConfigPayload | EventSourceConfigPayload | ✅ | | + +**Return Type** + +`EventSourceConfigPayload` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/integrations" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +request := integrations.EventSourceConfigPayload{ + Source: util.ToPointer("source"), +} + +response, err := client.Integrations.SaveEventsourceIntegration(context.Background(), request) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## DeleteEventsourceIntegration + +Deletes the EventSource integration configuration from the project. This will disable the integration's functionality within the project. + +- HTTP Method: `DELETE` +- Endpoint: `/integrations/eventsource` + +**Parameters** + +| Name | Type | Required | Description | +| :----- | :---------------------------------------- | :------- | :---------------------------- | +| ctx | Context | ✅ | Default go language context | +| params | DeleteEventsourceIntegrationRequestParams | ✅ | Additional request parameters | + +**Return Type** + +`any` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/integrations" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +params := integrations.DeleteEventsourceIntegrationRequestParams{ + Id: util.ToPointer("id"), +} + +response, err := client.Integrations.DeleteEventsourceIntegration(context.Background(), params) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + ## ListExpoIntegrations Retrieves the current Expo integration configurations for a specific integration type in the project. Returns configuration details and status information. @@ -253,12 +408,14 @@ Retrieves the current Expo integration configurations for a specific integration import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListExpoIntegrations(context.Background()) @@ -293,6 +450,7 @@ Updates or creates the Expo integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -300,11 +458,12 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.ExpoConfigPayload{ - AccessToken: util.ToPointer("AccessToken"), + AccessToken: util.ToPointer("access_token"), } response, err := client.Integrations.SaveExpoIntegration(context.Background(), request) @@ -339,18 +498,20 @@ Deletes the Expo integration configuration from the project. This will disable t import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteExpoIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteExpoIntegration(context.Background(), params) @@ -384,12 +545,14 @@ Retrieves the current FCM integration configurations for a specific integration import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListFcmIntegrations(context.Background()) @@ -424,6 +587,7 @@ Updates or creates the FCM integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -431,22 +595,25 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) type_ := integrations.TYPE_SERVICE_ACCOUNT request := integrations.FcmConfigPayload{ - AuthProviderX509CertUrl: util.ToPointer("AuthProviderX509CertUrl"), - AuthUri: util.ToPointer("AuthUri"), - ClientEmail: util.ToPointer("ClientEmail"), - ClientId: util.ToPointer("ClientId"), - ClientX509CertUrl: util.ToPointer("ClientX509CertUrl"), - PrivateKey: util.ToPointer("PrivateKey"), - PrivateKeyId: util.ToPointer("PrivateKeyId"), - ProjectId: util.ToPointer("ProjectId"), - TokenUri: util.ToPointer("TokenUri"), + AuthProviderX509CertUrl: util.ToPointer("auth_provider_x509_cert_url"), + AuthUri: util.ToPointer("auth_uri"), + ClientEmail: util.ToPointer("client_email"), + ClientId: util.ToPointer("client_id"), + ClientX509CertUrl: util.ToPointer("client_x509_cert_url"), + PrivateKey: util.ToPointer(" BEGINNNHB-------- +BRMn2Y= +--- ENDUZSZ-----------"), + PrivateKeyId: util.ToPointer("private_key_id"), + ProjectId: util.ToPointer("project_id"), + TokenUri: util.ToPointer("token_uri"), Type_: &type_, - UniverseDomain: util.ToPointer("UniverseDomain"), + UniverseDomain: util.ToPointer("universe_domain"), } response, err := client.Integrations.SaveFcmIntegration(context.Background(), request) @@ -481,18 +648,20 @@ Deletes the FCM integration configuration from the project. This will disable th import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteFcmIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteFcmIntegration(context.Background(), params) @@ -526,12 +695,14 @@ Retrieves the current GitHub integration configurations for a specific integrati import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListGithubIntegrations(context.Background()) @@ -566,6 +737,7 @@ Updates or creates the GitHub integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -573,11 +745,12 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.GithubConfigPayload{ - WebhookSigningSecret: util.ToPointer("WebhookSigningSecret"), + WebhookSigningSecret: util.ToPointer("webhook_signing_secret"), } response, err := client.Integrations.SaveGithubIntegration(context.Background(), request) @@ -612,18 +785,20 @@ Deletes the GitHub integration configuration from the project. This will disable import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteGithubIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteGithubIntegration(context.Background(), params) @@ -657,12 +832,14 @@ Retrieves the current Inbox integration configurations for a specific integratio import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListInboxIntegrations(context.Background()) @@ -697,6 +874,7 @@ Updates or creates the Inbox integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -704,104 +882,105 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) images := integrations.Images{ - EmptyInboxUrl: util.ToPointer("EmptyInboxUrl"), + EmptyInboxUrl: util.ToPointer("emptyInboxUrl"), } banner := integrations.Banner{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BackgroundOpacity: util.ToPointer(float64(123)), - FontSize: util.ToPointer("FontSize"), - TextColor: util.ToPointer("TextColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + BackgroundOpacity: util.ToPointer(float64(0.65)), + FontSize: util.ToPointer("fontSize"), + TextColor: util.ToPointer("textColor"), } dialog := integrations.Dialog{ - AccentColor: util.ToPointer("AccentColor"), - BackgroundColor: util.ToPointer("BackgroundColor"), - TextColor: util.ToPointer("TextColor"), + AccentColor: util.ToPointer("accentColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + TextColor: util.ToPointer("textColor"), } footer := integrations.Footer{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BorderRadius: util.ToPointer("BorderRadius"), - FontSize: util.ToPointer("FontSize"), - TextColor: util.ToPointer("TextColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + BorderRadius: util.ToPointer("borderRadius"), + FontSize: util.ToPointer("fontSize"), + TextColor: util.ToPointer("textColor"), } header := integrations.Header{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BorderRadius: util.ToPointer("BorderRadius"), - FontFamily: util.ToPointer("FontFamily"), - FontSize: util.ToPointer("FontSize"), - TextColor: util.ToPointer("TextColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + BorderRadius: util.ToPointer("borderRadius"), + FontFamily: util.ToPointer("fontFamily"), + FontSize: util.ToPointer("fontSize"), + TextColor: util.ToPointer("textColor"), } icon := integrations.Icon{ - BorderColor: util.ToPointer("BorderColor"), - Width: util.ToPointer("Width"), + BorderColor: util.ToPointer("borderColor"), + Width: util.ToPointer("width"), } defaultHover := integrations.DefaultHover{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } defaultState := integrations.DefaultState{ - Color: util.ToPointer("Color"), + Color: util.ToPointer("color"), } default_ := integrations.Default_{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BorderRadius: util.ToPointer("BorderRadius"), - FontFamily: util.ToPointer("FontFamily"), - FontSize: util.ToPointer("FontSize"), + BackgroundColor: util.ToPointer("backgroundColor"), + BorderRadius: util.ToPointer("borderRadius"), + FontFamily: util.ToPointer("fontFamily"), + FontSize: util.ToPointer("fontSize"), Hover: &defaultHover, - Margin: util.ToPointer("Margin"), + Margin: util.ToPointer("margin"), State: &defaultState, - TextColor: util.ToPointer("TextColor"), + TextColor: util.ToPointer("textColor"), } unreadHover := integrations.UnreadHover{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } unreadState := integrations.UnreadState{ - Color: util.ToPointer("Color"), + Color: util.ToPointer("color"), } unread := integrations.Unread{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), Hover: &unreadHover, State: &unreadState, - TextColor: util.ToPointer("TextColor"), + TextColor: util.ToPointer("textColor"), } unseenHover := integrations.UnseenHover{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } unseenState := integrations.UnseenState{ - Color: util.ToPointer("Color"), + Color: util.ToPointer("color"), } unseen := integrations.Unseen{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), Hover: &unseenHover, State: &unseenState, - TextColor: util.ToPointer("TextColor"), + TextColor: util.ToPointer("textColor"), } notification := integrations.Notification{ @@ -812,7 +991,7 @@ notification := integrations.Notification{ unseenBadge := integrations.UnseenBadge{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } theme := integrations.Theme{ @@ -827,7 +1006,7 @@ theme := integrations.Theme{ request := integrations.InboxConfigPayload{ Images: &images, - Locale: util.ToPointer(util.Nullable[string]{ Value: "Locale" }), + Locale: util.ToPointer(util.Nullable[string]{ Value: "locale" }), Theme: &theme, } @@ -863,18 +1042,20 @@ Deletes the Inbox integration configuration from the project. This will disable import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteInboxIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteInboxIntegration(context.Background(), params) @@ -908,12 +1089,14 @@ Retrieves the current Mailgun integration configurations for a specific integrat import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListMailgunIntegrations(context.Background()) @@ -948,6 +1131,7 @@ Updates or creates the Mailgun integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -955,19 +1139,20 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) mailgunConfigPayloadFrom := integrations.MailgunConfigPayloadFrom{ - Email: util.ToPointer("Email"), - Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }), + Email: util.ToPointer("email"), + Name: util.ToPointer(util.Nullable[string]{ Value: "name" }), } region := integrations.REGION_US request := integrations.MailgunConfigPayload{ - ApiKey: util.ToPointer("ApiKey"), - Domain: util.ToPointer("Domain"), + ApiKey: util.ToPointer("api_key"), + Domain: util.ToPointer("domain"), From: &mailgunConfigPayloadFrom, Region: ®ion, } @@ -1004,18 +1189,20 @@ Deletes the Mailgun integration configuration from the project. This will disabl import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteMailgunIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteMailgunIntegration(context.Background(), params) @@ -1049,12 +1236,14 @@ Retrieves the current Ping Email integration configurations for a specific integ import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListPingEmailIntegrations(context.Background()) @@ -1089,6 +1278,7 @@ Updates or creates the Ping Email integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1096,11 +1286,12 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.PingConfigPayload{ - Url: util.ToPointer("Url"), + Url: util.ToPointer("url"), } response, err := client.Integrations.SavePingEmailIntegration(context.Background(), request) @@ -1135,18 +1326,20 @@ Deletes the Ping Email integration configuration from the project. This will dis import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeletePingEmailIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeletePingEmailIntegration(context.Background(), params) @@ -1180,12 +1373,14 @@ Retrieves the current SendGrid integration configurations for a specific integra import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListSendgridIntegrations(context.Background()) @@ -1220,6 +1415,7 @@ Updates or creates the SendGrid integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1227,24 +1423,25 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) sendgridConfigPayloadFrom := integrations.SendgridConfigPayloadFrom{ - Email: util.ToPointer("Email"), - Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }), + Email: util.ToPointer("email"), + Name: util.ToPointer(util.Nullable[string]{ Value: "name" }), } -replyTo := integrations.ReplyTo{ - Email: util.ToPointer("Email"), - Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }), +sendgridConfigPayloadReplyTo := integrations.SendgridConfigPayloadReplyTo{ + Email: util.ToPointer("email"), + Name: util.ToPointer(util.Nullable[string]{ Value: "name" }), } request := integrations.SendgridConfigPayload{ - ApiKey: util.ToPointer("ApiKey"), + ApiKey: util.ToPointer("api_key"), From: &sendgridConfigPayloadFrom, - ReplyTo: &replyTo, + ReplyTo: &sendgridConfigPayloadReplyTo, } response, err := client.Integrations.SaveSendgridIntegration(context.Background(), request) @@ -1279,18 +1476,20 @@ Deletes the SendGrid integration configuration from the project. This will disab import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteSendgridIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteSendgridIntegration(context.Background(), params) @@ -1324,12 +1523,14 @@ Retrieves the current Amazon SES integration configurations for a specific integ import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListSesIntegrations(context.Background()) @@ -1364,6 +1565,7 @@ Updates or creates the Amazon SES integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1371,19 +1573,20 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) sesConfigPayloadFrom := integrations.SesConfigPayloadFrom{ - Email: util.ToPointer("Email"), - Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }), + Email: util.ToPointer("email"), + Name: util.ToPointer(util.Nullable[string]{ Value: "name" }), } request := integrations.SesConfigPayload{ From: &sesConfigPayloadFrom, - KeyId: util.ToPointer("KeyId"), - Region: util.ToPointer("Region"), - SecretKey: util.ToPointer("SecretKey"), + KeyId: util.ToPointer("key_id"), + Region: util.ToPointer("region"), + SecretKey: util.ToPointer("secret_key"), } response, err := client.Integrations.SaveSesIntegration(context.Background(), request) @@ -1418,18 +1621,20 @@ Deletes the Amazon SES integration configuration from the project. This will dis import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteSesIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteSesIntegration(context.Background(), params) @@ -1463,12 +1668,14 @@ Retrieves the current Slack integration configurations for a specific integratio import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListSlackIntegrations(context.Background()) @@ -1503,6 +1710,7 @@ Updates or creates the Slack integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1510,14 +1718,15 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.SlackConfigPayload{ - AppId: util.ToPointer("AppId"), - ClientId: util.ToPointer("ClientId"), - ClientSecret: util.ToPointer("ClientSecret"), - SigningSecret: util.ToPointer("SigningSecret"), + AppId: util.ToPointer("0N49M3LDY"), + ClientId: util.ToPointer("1578.9"), + ClientSecret: util.ToPointer("fugiatquis dolore magnacillumdo "), + SigningSecret: util.ToPointer("laboris Duissint cillum ipsumid "), } response, err := client.Integrations.SaveSlackIntegration(context.Background(), request) @@ -1552,18 +1761,20 @@ Deletes the Slack integration configuration from the project. This will disable import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteSlackIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteSlackIntegration(context.Background(), params) @@ -1574,6 +1785,162 @@ if err != nil { fmt.Println(response) ``` +## ListSmtpIntegrations + +Retrieves the current SMTP integration configurations for a specific integration type in the project. Returns configuration details and status information. + +- HTTP Method: `GET` +- Endpoint: `/integrations/smtp` + +**Parameters** + +| Name | Type | Required | Description | +| :--- | :------ | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | + +**Return Type** + +`SmtpConfigObjectCollection` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + +response, err := client.Integrations.ListSmtpIntegrations(context.Background()) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## SaveSmtpIntegration + +Updates or creates the SMTP integration for the project. + +- HTTP Method: `PUT` +- Endpoint: `/integrations/smtp` + +**Parameters** + +| Name | Type | Required | Description | +| :--------- | :--------- | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| smtpConfig | SmtpConfig | ✅ | | + +**Return Type** + +`SmtpConfig` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/integrations" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +smtpConfigFrom := integrations.SmtpConfigFrom{ + Email: util.ToPointer("email"), + Name: util.ToPointer("name"), +} + + +smtpConfigReplyTo := integrations.SmtpConfigReplyTo{ + Email: util.ToPointer("email"), + Name: util.ToPointer("name"), +} + +security := integrations.SECURITY_NONE + +request := integrations.SmtpConfig{ + From: &smtpConfigFrom, + Host: util.ToPointer("smtp.gmail.com"), + Password: util.ToPointer("password"), + Port: util.ToPointer(int64(25)), + ReplyTo: &smtpConfigReplyTo, + Security: &security, + Username: util.ToPointer("username"), +} + +response, err := client.Integrations.SaveSmtpIntegration(context.Background(), request) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## DeleteSmtpIntegration + +Deletes the SMTP integration configuration from the project. This will disable the integration's functionality within the project. + +- HTTP Method: `DELETE` +- Endpoint: `/integrations/smtp` + +**Parameters** + +| Name | Type | Required | Description | +| :----- | :--------------------------------- | :------- | :---------------------------- | +| ctx | Context | ✅ | Default go language context | +| params | DeleteSmtpIntegrationRequestParams | ✅ | Additional request parameters | + +**Return Type** + +`any` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/integrations" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +params := integrations.DeleteSmtpIntegrationRequestParams{ + Id: util.ToPointer("id"), +} + +response, err := client.Integrations.DeleteSmtpIntegration(context.Background(), params) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + ## ListStripeIntegrations Retrieves the current Stripe integration configurations for a specific integration type in the project. Returns configuration details and status information. @@ -1597,12 +1964,14 @@ Retrieves the current Stripe integration configurations for a specific integrati import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListStripeIntegrations(context.Background()) @@ -1637,6 +2006,7 @@ Updates or creates the Stripe integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1644,11 +2014,13 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.StripeConfigPayload{ - WebhookSigningSecret: util.ToPointer("WebhookSigningSecret"), + Id: util.ToPointer("id"), + WebhookSigningSecret: util.ToPointer("webhook_signing_secret"), } response, err := client.Integrations.SaveStripeIntegration(context.Background(), request) @@ -1683,18 +2055,20 @@ Deletes the Stripe integration configuration from the project. This will disable import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteStripeIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteStripeIntegration(context.Background(), params) @@ -1728,12 +2102,14 @@ Retrieves the current Twilio integration configurations for a specific integrati import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListTwilioIntegrations(context.Background()) @@ -1768,6 +2144,7 @@ Updates or creates the Twilio integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1775,14 +2152,15 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.TwilioConfigPayload{ - AccountSid: util.ToPointer("AccountSid"), - ApiKey: util.ToPointer("ApiKey"), - ApiSecret: util.ToPointer("ApiSecret"), - From: util.ToPointer("From"), + AccountSid: util.ToPointer("account_sid"), + ApiKey: util.ToPointer("api_key"), + ApiSecret: util.ToPointer("api_secret"), + From: util.ToPointer("+38"), } response, err := client.Integrations.SaveTwilioIntegration(context.Background(), request) @@ -1817,18 +2195,20 @@ Deletes the Twilio integration configuration from the project. This will disable import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteTwilioIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteTwilioIntegration(context.Background(), params) @@ -1862,12 +2242,14 @@ Retrieves the current Web Push integration configurations for a specific integra import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.ListWebPushIntegrations(context.Background()) @@ -1902,6 +2284,7 @@ Updates or creates the Web Push integration for the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -1909,12 +2292,13 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.WebpushConfigPayload{ - PrivateKey: util.ToPointer("PrivateKey"), - PublicKey: util.ToPointer("PublicKey"), + PrivateKey: util.ToPointer("private_key"), + PublicKey: util.ToPointer("public_key"), } response, err := client.Integrations.SaveWebPushIntegration(context.Background(), request) @@ -1949,18 +2333,20 @@ Deletes the Web Push integration configuration from the project. This will disab import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := integrations.DeleteWebPushIntegrationRequestParams{ - + Id: util.ToPointer("id"), } response, err := client.Integrations.DeleteWebPushIntegration(context.Background(), params) diff --git a/docs/project-client/services/users_service.md b/docs/project-client/services/users_service.md index c22c913..65883a6 100644 --- a/docs/project-client/services/users_service.md +++ b/docs/project-client/services/users_service.md @@ -32,18 +32,23 @@ Lists all users in the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" - + "github.com/magicbell/magicbell-go/pkg/project-client/util" "github.com/magicbell/magicbell-go/pkg/project-client/users" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := users.ListUsersRequestParams{ - + Limit: util.ToPointer(int64(6)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), + Query: util.ToPointer("query"), } response, err := client.Users.ListUsers(context.Background(), params) @@ -78,6 +83,7 @@ Creates or updates a user with the provided details. The user will be associated import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" "github.com/magicbell/magicbell-go/pkg/project-client/util" @@ -85,20 +91,21 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := shared.User{ - CreatedAt: util.ToPointer(util.Nullable[string]{ Value: "CreatedAt" }), + CreatedAt: util.ToPointer(util.Nullable[string]{ Value: "created_at" }), CustomAttributes: []byte{}, - Email: util.ToPointer(util.Nullable[string]{ Value: "Email" }), - ExternalId: util.ToPointer(util.Nullable[string]{ Value: "ExternalId" }), - FirstName: util.ToPointer(util.Nullable[string]{ Value: "FirstName" }), - Id: util.ToPointer("Id"), - LastName: util.ToPointer(util.Nullable[string]{ Value: "LastName" }), - LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: "LastNotifiedAt" }), - LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: "LastSeenAt" }), - UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: "UpdatedAt" }), + Email: util.ToPointer(util.Nullable[string]{ Value: "email" }), + ExternalId: util.ToPointer(util.Nullable[string]{ Value: "external_id" }), + FirstName: util.ToPointer(util.Nullable[string]{ Value: "first_name" }), + Id: util.ToPointer("id"), + LastName: util.ToPointer(util.Nullable[string]{ Value: "last_name" }), + LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: "last_notified_at" }), + LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: "last_seen_at" }), + UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: "updated_at" }), } response, err := client.Users.SaveUser(context.Background(), request) @@ -133,15 +140,17 @@ Removes a user and all associated data from the project. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/project-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Users.DeleteUser(context.Background(), "userId") +response, err := client.Users.DeleteUser(context.Background(), "user_id") if err != nil { panic(err) } diff --git a/docs/project-client/services/workflows_service.md b/docs/project-client/services/workflows_service.md new file mode 100644 index 0000000..2857ea9 --- /dev/null +++ b/docs/project-client/services/workflows_service.md @@ -0,0 +1,241 @@ +# WorkflowsService + +A list of all methods in the `WorkflowsService` service. Click on the method name to view detailed information about that method. + +| Methods | Description | +| :-------------------------------------- | :------------------------------------------------------- | +| [SaveWorkflow](#saveworkflow) | Creates or updates a workflow definition for the project | +| [FetchWorkflow](#fetchworkflow) | Retrieves a workflow definition by key | +| [CreateWorkflowRun](#createworkflowrun) | Executes a workflow with the provided input parameters | +| [FetchWorkflowRun](#fetchworkflowrun) | Retrieves the status and details of a workflow run | +| [ListWorkflowRuns](#listworkflowruns) | Retrieves all runs for a specific workflow | + +## SaveWorkflow + +Creates or updates a workflow definition for the project + +- HTTP Method: `PUT` +- Endpoint: `/workflows` + +**Parameters** + +| Name | Type | Required | Description | +| :----------------- | :----------------- | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| workflowDefinition | WorkflowDefinition | ✅ | | + +**Return Type** + +`WorkflowDefinition` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/workflows" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +steps := workflows.Steps{ + Command: util.ToPointer("command"), + If_: util.ToPointer(util.Nullable[string]{ Value: "if" }), + Input: []byte{}, +} + +request := workflows.WorkflowDefinition{ + Disabled: util.ToPointer(true), + Key: util.ToPointer("key"), + Steps: []workflows.Steps{steps}, +} + +response, err := client.Workflows.SaveWorkflow(context.Background(), request) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## FetchWorkflow + +Retrieves a workflow definition by key + +- HTTP Method: `GET` +- Endpoint: `/workflows/*` + +**Parameters** + +| Name | Type | Required | Description | +| :--- | :------ | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | + +**Return Type** + +`WorkflowDefinition` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + +response, err := client.Workflows.FetchWorkflow(context.Background()) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## CreateWorkflowRun + +Executes a workflow with the provided input parameters + +- HTTP Method: `POST` +- Endpoint: `/workflows/runs` + +**Parameters** + +| Name | Type | Required | Description | +| :--------------------- | :--------------------- | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| executeWorkflowRequest | ExecuteWorkflowRequest | ✅ | | + +**Return Type** + +`CreateRunResponse` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + "github.com/magicbell/magicbell-go/pkg/project-client/util" + "github.com/magicbell/magicbell-go/pkg/project-client/workflows" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +request := workflows.ExecuteWorkflowRequest{ + Input: []byte{}, + Key: util.ToPointer("key"), +} + +response, err := client.Workflows.CreateWorkflowRun(context.Background(), request) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## FetchWorkflowRun + +Retrieves the status and details of a workflow run + +- HTTP Method: `GET` +- Endpoint: `/workflows/runs/{run_id}` + +**Parameters** + +| Name | Type | Required | Description | +| :---- | :------ | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| runId | string | ✅ | | + +**Return Type** + +`GetRunResponse` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + +response, err := client.Workflows.FetchWorkflowRun(context.Background(), "run_id") +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## ListWorkflowRuns + +Retrieves all runs for a specific workflow + +- HTTP Method: `GET` +- Endpoint: `/workflows/{workflow_key}/runs` + +**Parameters** + +| Name | Type | Required | Description | +| :---------- | :------ | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| workflowKey | string | ✅ | | + +**Return Type** + +`WorkflowRunCollection` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/client" + +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + +response, err := client.Workflows.ListWorkflowRuns(context.Background(), "workflow_key") +if err != nil { + panic(err) +} + +fmt.Println(response) +``` diff --git a/docs/project-client/snippets/snippets.json b/docs/project-client/snippets/snippets.json index 7cb4b77..090a554 100644 --- a/docs/project-client/snippets/snippets.json +++ b/docs/project-client/snippets/snippets.json @@ -1,149 +1,175 @@ { "endpoints": { "/broadcasts": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := broadcasts.ListBroadcastsRequestParams{\n\n}\n\nresponse, err := client.Broadcasts.ListBroadcasts(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nemail := broadcasts.Email{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"ActionUrl\" }),\n Content: util.ToPointer(\"Content\"),\n Title: util.ToPointer(\"Title\"),\n}\n\n\ninApp := broadcasts.InApp{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"ActionUrl\" }),\n Content: util.ToPointer(\"Content\"),\n Title: util.ToPointer(\"Title\"),\n}\n\n\nmobilePush := broadcasts.MobilePush{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"ActionUrl\" }),\n Content: util.ToPointer(\"Content\"),\n Title: util.ToPointer(\"Title\"),\n}\n\n\nsms := broadcasts.Sms{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"ActionUrl\" }),\n Content: util.ToPointer(\"Content\"),\n Title: util.ToPointer(\"Title\"),\n}\n\noverridesChannels := broadcasts.OverridesChannels{\n Email: &email,\n InApp: &inApp,\n MobilePush: &mobilePush,\n Sms: &sms,\n}\n\n\nproviders := broadcasts.Providers{\n Apns: []byte{},\n Expo: []byte{},\n Fcm: []byte{},\n Mailgun: []byte{},\n Sendgrid: []byte{},\n Ses: []byte{},\n Slack: []byte{},\n Teams: []byte{},\n Twilio: []byte{},\n WebPush: []byte{},\n}\n\noverrides := broadcasts.Overrides{\n Channels: &overridesChannels,\n Providers: &providers,\n}\n\n\nuser := shared.User{\n CreatedAt: util.ToPointer(util.Nullable[string]{ Value: \"CreatedAt\" }),\n CustomAttributes: []byte{},\n Email: util.ToPointer(util.Nullable[string]{ Value: \"Email\" }),\n ExternalId: util.ToPointer(util.Nullable[string]{ Value: \"ExternalId\" }),\n FirstName: util.ToPointer(util.Nullable[string]{ Value: \"FirstName\" }),\n Id: util.ToPointer(\"Id\"),\n LastName: util.ToPointer(util.Nullable[string]{ Value: \"LastName\" }),\n LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: \"LastNotifiedAt\" }),\n LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: \"LastSeenAt\" }),\n UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: \"UpdatedAt\" }),\n}\n\n\nerrors := broadcasts.Errors{\n Message: util.ToPointer(\"Message\"),\n}\n\nstatusStatus := broadcasts.STATUS_STATUS_ENQUEUED\n\n\nsummary := broadcasts.Summary{\n Failures: util.ToPointer(int64(123)),\n Total: util.ToPointer(int64(123)),\n}\n\nbroadcastStatus := broadcasts.BroadcastStatus{\n Errors: []broadcasts.Errors{errors},\n Status: &statusStatus,\n Summary: &summary,\n}\n\nrequest := broadcasts.Broadcast{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"ActionUrl\" }),\n Category: util.ToPointer(util.Nullable[string]{ Value: \"Category\" }),\n Content: util.ToPointer(util.Nullable[string]{ Value: \"Content\" }),\n CreatedAt: util.ToPointer(\"CreatedAt\"),\n CustomAttributes: []byte{},\n Id: util.ToPointer(\"Id\"),\n Overrides: &overrides,\n Recipients: []shared.User{user},\n Status: &broadcastStatus,\n Title: util.ToPointer(\"Title\"),\n Topic: util.ToPointer(util.Nullable[string]{ Value: \"Topic\" }),\n}\n\nresponse, err := client.Broadcasts.CreateBroadcast(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := broadcasts.ListBroadcastsRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Broadcasts.ListBroadcasts(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nemail := broadcasts.Email{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"action_url\" }),\n Content: util.ToPointer(\"content\"),\n Title: util.ToPointer(\"title\"),\n}\n\n\ninApp := broadcasts.InApp{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"action_url\" }),\n Content: util.ToPointer(\"content\"),\n Title: util.ToPointer(\"title\"),\n}\n\n\nmobilePush := broadcasts.MobilePush{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"action_url\" }),\n Content: util.ToPointer(\"content\"),\n Title: util.ToPointer(\"title\"),\n}\n\n\nsms := broadcasts.Sms{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"action_url\" }),\n Content: util.ToPointer(\"content\"),\n Title: util.ToPointer(\"title\"),\n}\n\noverridesChannels := broadcasts.OverridesChannels{\n Email: &email,\n InApp: &inApp,\n MobilePush: &mobilePush,\n Sms: &sms,\n}\n\n\nproviders := broadcasts.Providers{\n Apns: []byte{},\n Expo: []byte{},\n Fcm: []byte{},\n Mailgun: []byte{},\n Sendgrid: []byte{},\n Ses: []byte{},\n Slack: []byte{},\n Teams: []byte{},\n Twilio: []byte{},\n WebPush: []byte{},\n}\n\noverrides := broadcasts.Overrides{\n Channels: &overridesChannels,\n Providers: &providers,\n}\n\n\nuser := shared.User{\n CreatedAt: util.ToPointer(util.Nullable[string]{ Value: \"created_at\" }),\n CustomAttributes: []byte{},\n Email: util.ToPointer(util.Nullable[string]{ Value: \"email\" }),\n ExternalId: util.ToPointer(util.Nullable[string]{ Value: \"external_id\" }),\n FirstName: util.ToPointer(util.Nullable[string]{ Value: \"first_name\" }),\n Id: util.ToPointer(\"id\"),\n LastName: util.ToPointer(util.Nullable[string]{ Value: \"last_name\" }),\n LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: \"last_notified_at\" }),\n LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: \"last_seen_at\" }),\n UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: \"updated_at\" }),\n}\n\n\nerrors := broadcasts.Errors{\n Message: util.ToPointer(\"message\"),\n}\n\nstatusStatus := broadcasts.STATUS_STATUS_ENQUEUED\n\n\nsummary := broadcasts.Summary{\n Failures: util.ToPointer(int64(8)),\n Total: util.ToPointer(int64(1)),\n}\n\nbroadcastStatus := broadcasts.BroadcastStatus{\n Errors: []broadcasts.Errors{errors},\n Status: &statusStatus,\n Summary: &summary,\n}\n\nrequest := broadcasts.Broadcast{\n ActionUrl: util.ToPointer(util.Nullable[string]{ Value: \"action_url\" }),\n Category: util.ToPointer(util.Nullable[string]{ Value: \"category\" }),\n Content: util.ToPointer(util.Nullable[string]{ Value: \"content\" }),\n CreatedAt: util.ToPointer(\"created_at\"),\n CustomAttributes: []byte{},\n Id: util.ToPointer(\"id\"),\n Overrides: &overrides,\n Recipients: []shared.User{user},\n Status: &broadcastStatus,\n Title: util.ToPointer(\"title\"),\n Topic: util.ToPointer(util.Nullable[string]{ Value: \"topic\" }),\n}\n\nresponse, err := client.Broadcasts.CreateBroadcast(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/broadcasts/{broadcast_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Broadcasts.FetchBroadcast(context.Background(), \"broadcastId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Broadcasts.FetchBroadcast(context.Background(), \"broadcast_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels": { - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nchannel := channels.CHANNEL_IN_APP\n\ncategoryDeliveryConfigChannels := channels.CategoryDeliveryConfigChannels{\n Channel: &channel,\n Delay: util.ToPointer(int64(123)),\n If_: util.ToPointer(util.Nullable[string]{ Value: \"If_\" }),\n}\n\nrequest := channels.CategoryDeliveryConfig{\n Channels: []channels.CategoryDeliveryConfigChannels{categoryDeliveryConfigChannels},\n Disabled: util.ToPointer(true),\n Key: util.ToPointer(\"Key\"),\n}\n\nresponse, err := client.Channels.SaveChannelsConfig(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nchannel := channels.CHANNEL_IN_APP\n\ncategoryDeliveryConfigChannels := channels.CategoryDeliveryConfigChannels{\n Channel: &channel,\n Delay: util.ToPointer(int64(5)),\n If_: util.ToPointer(util.Nullable[string]{ Value: \"if\" }),\n}\n\nrequest := channels.CategoryDeliveryConfig{\n Channels: []channels.CategoryDeliveryConfigChannels{categoryDeliveryConfigChannels},\n Disabled: util.ToPointer(true),\n Key: util.ToPointer(\"key\"),\n}\n\nresponse, err := client.Channels.SaveChannelsConfig(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/{key}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchChannelsConfig(context.Background(), \"key\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchChannelsConfig(context.Background(), \"key\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/in_app/inbox/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserInboxTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserInboxTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserInboxTokensRequestParams{\n Limit: util.ToPointer(int64(4)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserInboxTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/in_app/inbox/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserInboxToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserInboxToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserInboxToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserInboxToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/mobile_push/apns/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserApnsTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserApnsTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserApnsTokensRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserApnsTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserApnsToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserApnsToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserApnsToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserApnsToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/mobile_push/expo/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserExpoTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserExpoTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserExpoTokensRequestParams{\n Limit: util.ToPointer(int64(2)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserExpoTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserExpoToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserExpoToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserExpoToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserExpoToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/mobile_push/fcm/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserFcmTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserFcmTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserFcmTokensRequestParams{\n Limit: util.ToPointer(int64(1)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserFcmTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/mobile_push/fcm/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserFcmToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserFcmToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserFcmToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserFcmToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/slack/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserSlackTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserSlackTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserSlackTokensRequestParams{\n Limit: util.ToPointer(int64(7)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserSlackTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/slack/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserSlackToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserSlackToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserSlackToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserSlackToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/teams/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserTeamsTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserTeamsTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserTeamsTokensRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserTeamsTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/teams/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserTeamsToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserTeamsToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserTeamsToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserTeamsToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/web_push/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserWebPushTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListUserWebPushTokens(context.Background(), \"userId\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListUserWebPushTokensRequestParams{\n Limit: util.ToPointer(int64(3)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListUserWebPushTokens(context.Background(), \"user_id\", params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}/channels/web_push/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserWebPushToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserWebPushToken(context.Background(), \"userId\", \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserWebPushToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteUserWebPushToken(context.Background(), \"user_id\", \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/events": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/events\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := events.ListEventsRequestParams{\n\n}\n\nresponse, err := client.Events.ListEvents(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/events\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := events.ListEventsRequestParams{\n Limit: util.ToPointer(int64(3)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Events.ListEvents(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/events/{event_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Events.FetchEvent(context.Background(), \"eventId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Events.FetchEvent(context.Background(), \"event_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.ListIntegrationsRequestParams{\n\n}\n\nresponse, err := client.Integrations.ListIntegrations(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.ListIntegrationsRequestParams{\n Limit: util.ToPointer(int64(3)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Integrations.ListIntegrations(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/apns": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListApnsIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nbadge := integrations.BADGE_UNREAD\n\npayloadVersion := integrations.PAYLOAD_VERSION_1\n\nrequest := integrations.ApnsConfigPayload{\n AppId: util.ToPointer(\"AppId\"),\n Badge: &badge,\n Certificate: util.ToPointer(\"Certificate\"),\n KeyId: util.ToPointer(\"KeyId\"),\n PayloadVersion: &payloadVersion,\n TeamId: util.ToPointer(\"TeamId\"),\n}\n\nresponse, err := client.Integrations.SaveApnsIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteApnsIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteApnsIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListApnsIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nbadge := integrations.BADGE_UNREAD\n\npayloadVersion := integrations.PAYLOAD_VERSION_1\n\nrequest := integrations.ApnsConfigPayload{\n AppId: util.ToPointer(\"app_id\"),\n Badge: &badge,\n Certificate: util.ToPointer(\"----------- BEGIN PRIVATE KEY------\nm84591=\n------- END PRIVATE KEYYYYYY-------\"),\n KeyId: util.ToPointer(\"sintdolor \"),\n PayloadVersion: &payloadVersion,\n TeamId: util.ToPointer(\"laborumiru\"),\n}\n\nresponse, err := client.Integrations.SaveApnsIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteApnsIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteApnsIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/integrations/eventsource": { + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListEventsourceIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.EventSourceConfigPayload{\n Source: util.ToPointer(\"source\"),\n}\n\nresponse, err := client.Integrations.SaveEventsourceIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteEventsourceIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteEventsourceIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/expo": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListExpoIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.ExpoConfigPayload{\n AccessToken: util.ToPointer(\"AccessToken\"),\n}\n\nresponse, err := client.Integrations.SaveExpoIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteExpoIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteExpoIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListExpoIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.ExpoConfigPayload{\n AccessToken: util.ToPointer(\"access_token\"),\n}\n\nresponse, err := client.Integrations.SaveExpoIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteExpoIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteExpoIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/fcm": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListFcmIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\ntype_ := integrations.TYPE_SERVICE_ACCOUNT\n\nrequest := integrations.FcmConfigPayload{\n AuthProviderX509CertUrl: util.ToPointer(\"AuthProviderX509CertUrl\"),\n AuthUri: util.ToPointer(\"AuthUri\"),\n ClientEmail: util.ToPointer(\"ClientEmail\"),\n ClientId: util.ToPointer(\"ClientId\"),\n ClientX509CertUrl: util.ToPointer(\"ClientX509CertUrl\"),\n PrivateKey: util.ToPointer(\"PrivateKey\"),\n PrivateKeyId: util.ToPointer(\"PrivateKeyId\"),\n ProjectId: util.ToPointer(\"ProjectId\"),\n TokenUri: util.ToPointer(\"TokenUri\"),\n Type_: &type_,\n UniverseDomain: util.ToPointer(\"UniverseDomain\"),\n}\n\nresponse, err := client.Integrations.SaveFcmIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteFcmIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteFcmIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListFcmIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\ntype_ := integrations.TYPE_SERVICE_ACCOUNT\n\nrequest := integrations.FcmConfigPayload{\n AuthProviderX509CertUrl: util.ToPointer(\"auth_provider_x509_cert_url\"),\n AuthUri: util.ToPointer(\"auth_uri\"),\n ClientEmail: util.ToPointer(\"client_email\"),\n ClientId: util.ToPointer(\"client_id\"),\n ClientX509CertUrl: util.ToPointer(\"client_x509_cert_url\"),\n PrivateKey: util.ToPointer(\" BEGINNNHB--------\nBRMn2Y=\n--- ENDUZSZ-----------\"),\n PrivateKeyId: util.ToPointer(\"private_key_id\"),\n ProjectId: util.ToPointer(\"project_id\"),\n TokenUri: util.ToPointer(\"token_uri\"),\n Type_: &type_,\n UniverseDomain: util.ToPointer(\"universe_domain\"),\n}\n\nresponse, err := client.Integrations.SaveFcmIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteFcmIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteFcmIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/github": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListGithubIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.GithubConfigPayload{\n WebhookSigningSecret: util.ToPointer(\"WebhookSigningSecret\"),\n}\n\nresponse, err := client.Integrations.SaveGithubIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteGithubIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteGithubIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListGithubIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.GithubConfigPayload{\n WebhookSigningSecret: util.ToPointer(\"webhook_signing_secret\"),\n}\n\nresponse, err := client.Integrations.SaveGithubIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteGithubIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteGithubIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/inbox": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListInboxIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nimages := integrations.Images{\n EmptyInboxUrl: util.ToPointer(\"EmptyInboxUrl\"),\n}\n\n\nbanner := integrations.Banner{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BackgroundOpacity: util.ToPointer(float64(123)),\n FontSize: util.ToPointer(\"FontSize\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\ndialog := integrations.Dialog{\n AccentColor: util.ToPointer(\"AccentColor\"),\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nfooter := integrations.Footer{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BorderRadius: util.ToPointer(\"BorderRadius\"),\n FontSize: util.ToPointer(\"FontSize\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nheader := integrations.Header{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BorderRadius: util.ToPointer(\"BorderRadius\"),\n FontFamily: util.ToPointer(\"FontFamily\"),\n FontSize: util.ToPointer(\"FontSize\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nicon := integrations.Icon{\n BorderColor: util.ToPointer(\"BorderColor\"),\n Width: util.ToPointer(\"Width\"),\n}\n\n\ndefaultHover := integrations.DefaultHover{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\n\ndefaultState := integrations.DefaultState{\n Color: util.ToPointer(\"Color\"),\n}\n\ndefault_ := integrations.Default_{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BorderRadius: util.ToPointer(\"BorderRadius\"),\n FontFamily: util.ToPointer(\"FontFamily\"),\n FontSize: util.ToPointer(\"FontSize\"),\n Hover: &defaultHover,\n Margin: util.ToPointer(\"Margin\"),\n State: &defaultState,\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nunreadHover := integrations.UnreadHover{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\n\nunreadState := integrations.UnreadState{\n Color: util.ToPointer(\"Color\"),\n}\n\nunread := integrations.Unread{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n Hover: &unreadHover,\n State: &unreadState,\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nunseenHover := integrations.UnseenHover{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\n\nunseenState := integrations.UnseenState{\n Color: util.ToPointer(\"Color\"),\n}\n\nunseen := integrations.Unseen{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n Hover: &unseenHover,\n State: &unseenState,\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\nnotification := integrations.Notification{\n Default_: &default_,\n Unread: &unread,\n Unseen: &unseen,\n}\n\n\nunseenBadge := integrations.UnseenBadge{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\ntheme := integrations.Theme{\n Banner: &banner,\n Dialog: &dialog,\n Footer: &footer,\n Header: &header,\n Icon: &icon,\n Notification: ¬ification,\n UnseenBadge: &unseenBadge,\n}\n\nrequest := integrations.InboxConfigPayload{\n Images: &images,\n Locale: util.ToPointer(util.Nullable[string]{ Value: \"Locale\" }),\n Theme: &theme,\n}\n\nresponse, err := client.Integrations.SaveInboxIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteInboxIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteInboxIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListInboxIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nimages := integrations.Images{\n EmptyInboxUrl: util.ToPointer(\"emptyInboxUrl\"),\n}\n\n\nbanner := integrations.Banner{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BackgroundOpacity: util.ToPointer(float64(0.65)),\n FontSize: util.ToPointer(\"fontSize\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\ndialog := integrations.Dialog{\n AccentColor: util.ToPointer(\"accentColor\"),\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nfooter := integrations.Footer{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BorderRadius: util.ToPointer(\"borderRadius\"),\n FontSize: util.ToPointer(\"fontSize\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nheader := integrations.Header{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BorderRadius: util.ToPointer(\"borderRadius\"),\n FontFamily: util.ToPointer(\"fontFamily\"),\n FontSize: util.ToPointer(\"fontSize\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nicon := integrations.Icon{\n BorderColor: util.ToPointer(\"borderColor\"),\n Width: util.ToPointer(\"width\"),\n}\n\n\ndefaultHover := integrations.DefaultHover{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\n\ndefaultState := integrations.DefaultState{\n Color: util.ToPointer(\"color\"),\n}\n\ndefault_ := integrations.Default_{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BorderRadius: util.ToPointer(\"borderRadius\"),\n FontFamily: util.ToPointer(\"fontFamily\"),\n FontSize: util.ToPointer(\"fontSize\"),\n Hover: &defaultHover,\n Margin: util.ToPointer(\"margin\"),\n State: &defaultState,\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nunreadHover := integrations.UnreadHover{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\n\nunreadState := integrations.UnreadState{\n Color: util.ToPointer(\"color\"),\n}\n\nunread := integrations.Unread{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n Hover: &unreadHover,\n State: &unreadState,\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nunseenHover := integrations.UnseenHover{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\n\nunseenState := integrations.UnseenState{\n Color: util.ToPointer(\"color\"),\n}\n\nunseen := integrations.Unseen{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n Hover: &unseenHover,\n State: &unseenState,\n TextColor: util.ToPointer(\"textColor\"),\n}\n\nnotification := integrations.Notification{\n Default_: &default_,\n Unread: &unread,\n Unseen: &unseen,\n}\n\n\nunseenBadge := integrations.UnseenBadge{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\ntheme := integrations.Theme{\n Banner: &banner,\n Dialog: &dialog,\n Footer: &footer,\n Header: &header,\n Icon: &icon,\n Notification: ¬ification,\n UnseenBadge: &unseenBadge,\n}\n\nrequest := integrations.InboxConfigPayload{\n Images: &images,\n Locale: util.ToPointer(util.Nullable[string]{ Value: \"locale\" }),\n Theme: &theme,\n}\n\nresponse, err := client.Integrations.SaveInboxIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteInboxIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteInboxIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/mailgun": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListMailgunIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nmailgunConfigPayloadFrom := integrations.MailgunConfigPayloadFrom{\n Email: util.ToPointer(\"Email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"Name\" }),\n}\n\nregion := integrations.REGION_US\n\nrequest := integrations.MailgunConfigPayload{\n ApiKey: util.ToPointer(\"ApiKey\"),\n Domain: util.ToPointer(\"Domain\"),\n From: &mailgunConfigPayloadFrom,\n Region: ®ion,\n}\n\nresponse, err := client.Integrations.SaveMailgunIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteMailgunIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteMailgunIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListMailgunIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nmailgunConfigPayloadFrom := integrations.MailgunConfigPayloadFrom{\n Email: util.ToPointer(\"email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"name\" }),\n}\n\nregion := integrations.REGION_US\n\nrequest := integrations.MailgunConfigPayload{\n ApiKey: util.ToPointer(\"api_key\"),\n Domain: util.ToPointer(\"domain\"),\n From: &mailgunConfigPayloadFrom,\n Region: ®ion,\n}\n\nresponse, err := client.Integrations.SaveMailgunIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteMailgunIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteMailgunIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/ping_email": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListPingEmailIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.PingConfigPayload{\n Url: util.ToPointer(\"Url\"),\n}\n\nresponse, err := client.Integrations.SavePingEmailIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeletePingEmailIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeletePingEmailIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListPingEmailIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.PingConfigPayload{\n Url: util.ToPointer(\"url\"),\n}\n\nresponse, err := client.Integrations.SavePingEmailIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeletePingEmailIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeletePingEmailIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/sendgrid": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSendgridIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nsendgridConfigPayloadFrom := integrations.SendgridConfigPayloadFrom{\n Email: util.ToPointer(\"Email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"Name\" }),\n}\n\n\nreplyTo := integrations.ReplyTo{\n Email: util.ToPointer(\"Email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"Name\" }),\n}\n\nrequest := integrations.SendgridConfigPayload{\n ApiKey: util.ToPointer(\"ApiKey\"),\n From: &sendgridConfigPayloadFrom,\n ReplyTo: &replyTo,\n}\n\nresponse, err := client.Integrations.SaveSendgridIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSendgridIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteSendgridIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSendgridIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nsendgridConfigPayloadFrom := integrations.SendgridConfigPayloadFrom{\n Email: util.ToPointer(\"email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"name\" }),\n}\n\n\nsendgridConfigPayloadReplyTo := integrations.SendgridConfigPayloadReplyTo{\n Email: util.ToPointer(\"email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"name\" }),\n}\n\nrequest := integrations.SendgridConfigPayload{\n ApiKey: util.ToPointer(\"api_key\"),\n From: &sendgridConfigPayloadFrom,\n ReplyTo: &sendgridConfigPayloadReplyTo,\n}\n\nresponse, err := client.Integrations.SaveSendgridIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSendgridIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteSendgridIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/ses": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSesIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nsesConfigPayloadFrom := integrations.SesConfigPayloadFrom{\n Email: util.ToPointer(\"Email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"Name\" }),\n}\n\nrequest := integrations.SesConfigPayload{\n From: &sesConfigPayloadFrom,\n KeyId: util.ToPointer(\"KeyId\"),\n Region: util.ToPointer(\"Region\"),\n SecretKey: util.ToPointer(\"SecretKey\"),\n}\n\nresponse, err := client.Integrations.SaveSesIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSesIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteSesIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSesIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nsesConfigPayloadFrom := integrations.SesConfigPayloadFrom{\n Email: util.ToPointer(\"email\"),\n Name: util.ToPointer(util.Nullable[string]{ Value: \"name\" }),\n}\n\nrequest := integrations.SesConfigPayload{\n From: &sesConfigPayloadFrom,\n KeyId: util.ToPointer(\"key_id\"),\n Region: util.ToPointer(\"region\"),\n SecretKey: util.ToPointer(\"secret_key\"),\n}\n\nresponse, err := client.Integrations.SaveSesIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSesIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteSesIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/slack": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSlackIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.SlackConfigPayload{\n AppId: util.ToPointer(\"AppId\"),\n ClientId: util.ToPointer(\"ClientId\"),\n ClientSecret: util.ToPointer(\"ClientSecret\"),\n SigningSecret: util.ToPointer(\"SigningSecret\"),\n}\n\nresponse, err := client.Integrations.SaveSlackIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSlackIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteSlackIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSlackIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.SlackConfigPayload{\n AppId: util.ToPointer(\"0N49M3LDY\"),\n ClientId: util.ToPointer(\"1578.9\"),\n ClientSecret: util.ToPointer(\"fugiatquis dolore magnacillumdo \"),\n SigningSecret: util.ToPointer(\"laboris Duissint cillum ipsumid \"),\n}\n\nresponse, err := client.Integrations.SaveSlackIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSlackIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteSlackIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/integrations/smtp": { + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListSmtpIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nsmtpConfigFrom := integrations.SmtpConfigFrom{\n Email: util.ToPointer(\"email\"),\n Name: util.ToPointer(\"name\"),\n}\n\n\nsmtpConfigReplyTo := integrations.SmtpConfigReplyTo{\n Email: util.ToPointer(\"email\"),\n Name: util.ToPointer(\"name\"),\n}\n\nsecurity := integrations.SECURITY_NONE\n\nrequest := integrations.SmtpConfig{\n From: &smtpConfigFrom,\n Host: util.ToPointer(\"smtp.gmail.com\"),\n Password: util.ToPointer(\"password\"),\n Port: util.ToPointer(int64(25)),\n ReplyTo: &smtpConfigReplyTo,\n Security: &security,\n Username: util.ToPointer(\"username\"),\n}\n\nresponse, err := client.Integrations.SaveSmtpIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteSmtpIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteSmtpIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/stripe": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListStripeIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.StripeConfigPayload{\n WebhookSigningSecret: util.ToPointer(\"WebhookSigningSecret\"),\n}\n\nresponse, err := client.Integrations.SaveStripeIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteStripeIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteStripeIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListStripeIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.StripeConfigPayload{\n Id: util.ToPointer(\"id\"),\n WebhookSigningSecret: util.ToPointer(\"webhook_signing_secret\"),\n}\n\nresponse, err := client.Integrations.SaveStripeIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteStripeIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteStripeIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/twilio": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListTwilioIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.TwilioConfigPayload{\n AccountSid: util.ToPointer(\"AccountSid\"),\n ApiKey: util.ToPointer(\"ApiKey\"),\n ApiSecret: util.ToPointer(\"ApiSecret\"),\n From: util.ToPointer(\"From\"),\n}\n\nresponse, err := client.Integrations.SaveTwilioIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteTwilioIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteTwilioIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListTwilioIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.TwilioConfigPayload{\n AccountSid: util.ToPointer(\"account_sid\"),\n ApiKey: util.ToPointer(\"api_key\"),\n ApiSecret: util.ToPointer(\"api_secret\"),\n From: util.ToPointer(\"+38\"),\n}\n\nresponse, err := client.Integrations.SaveTwilioIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteTwilioIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteTwilioIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/web_push": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListWebPushIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.WebpushConfigPayload{\n PrivateKey: util.ToPointer(\"PrivateKey\"),\n PublicKey: util.ToPointer(\"PublicKey\"),\n}\n\nresponse, err := client.Integrations.SaveWebPushIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteWebPushIntegrationRequestParams{\n\n}\n\nresponse, err := client.Integrations.DeleteWebPushIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.ListWebPushIntegrations(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.WebpushConfigPayload{\n PrivateKey: util.ToPointer(\"private_key\"),\n PublicKey: util.ToPointer(\"public_key\"),\n}\n\nresponse, err := client.Integrations.SaveWebPushIntegration(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := integrations.DeleteWebPushIntegrationRequestParams{\n Id: util.ToPointer(\"id\"),\n}\n\nresponse, err := client.Integrations.DeleteWebPushIntegration(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/project-client/users\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := users.ListUsersRequestParams{\n\n}\n\nresponse, err := client.Users.ListUsers(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/shared\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := shared.User{\n CreatedAt: util.ToPointer(util.Nullable[string]{ Value: \"CreatedAt\" }),\n CustomAttributes: []byte{},\n Email: util.ToPointer(util.Nullable[string]{ Value: \"Email\" }),\n ExternalId: util.ToPointer(util.Nullable[string]{ Value: \"ExternalId\" }),\n FirstName: util.ToPointer(util.Nullable[string]{ Value: \"FirstName\" }),\n Id: util.ToPointer(\"Id\"),\n LastName: util.ToPointer(util.Nullable[string]{ Value: \"LastName\" }),\n LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: \"LastNotifiedAt\" }),\n LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: \"LastSeenAt\" }),\n UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: \"UpdatedAt\" }),\n}\n\nresponse, err := client.Users.SaveUser(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/users\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := users.ListUsersRequestParams{\n Limit: util.ToPointer(int64(6)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n Query: util.ToPointer(\"query\"),\n}\n\nresponse, err := client.Users.ListUsers(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/shared\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := shared.User{\n CreatedAt: util.ToPointer(util.Nullable[string]{ Value: \"created_at\" }),\n CustomAttributes: []byte{},\n Email: util.ToPointer(util.Nullable[string]{ Value: \"email\" }),\n ExternalId: util.ToPointer(util.Nullable[string]{ Value: \"external_id\" }),\n FirstName: util.ToPointer(util.Nullable[string]{ Value: \"first_name\" }),\n Id: util.ToPointer(\"id\"),\n LastName: util.ToPointer(util.Nullable[string]{ Value: \"last_name\" }),\n LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: \"last_notified_at\" }),\n LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: \"last_seen_at\" }),\n UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: \"updated_at\" }),\n}\n\nresponse, err := client.Users.SaveUser(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/users/{user_id}": { - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Users.DeleteUser(context.Background(), \"userId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Users.DeleteUser(context.Background(), \"user_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/workflows": { + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/workflows\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nsteps := workflows.Steps{\n Command: util.ToPointer(\"command\"),\n If_: util.ToPointer(util.Nullable[string]{ Value: \"if\" }),\n Input: []byte{},\n}\n\nrequest := workflows.WorkflowDefinition{\n Disabled: util.ToPointer(true),\n Key: util.ToPointer(\"key\"),\n Steps: []workflows.Steps{steps},\n}\n\nresponse, err := client.Workflows.SaveWorkflow(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/workflows/*": { + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Workflows.FetchWorkflow(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/workflows/runs": { + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/workflows\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := workflows.ExecuteWorkflowRequest{\n Input: []byte{},\n Key: util.ToPointer(\"key\"),\n}\n\nresponse, err := client.Workflows.CreateWorkflowRun(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/workflows/runs/{run_id}": { + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Workflows.FetchWorkflowRun(context.Background(), \"run_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/workflows/{workflow_key}/runs": { + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Workflows.ListWorkflowRuns(context.Background(), \"workflow_key\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" } }, + "example": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := broadcasts.ListBroadcastsRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Broadcasts.ListBroadcasts(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", "authentication": { "bearer": { "constructor": "import (\n \"github.com/magicbell/magicbell-go/pkg/project-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig\"\n )\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"YOUR-TOKEN\")\n\nsdk := client.NewClient(config)", diff --git a/docs/user-client/README.md b/docs/user-client/README.md index e63a129..94cdebd 100644 --- a/docs/user-client/README.md +++ b/docs/user-client/README.md @@ -8,6 +8,14 @@ title: "user-client" This SDK is compatible with the following versions: `Go >= 1.19.0` +## Installation + +To get started with the SDK, we recommend installing using `go get`: + +```bash +go get client +``` + ## Authentication ### Access Token Authentication @@ -46,11 +54,60 @@ sdk := client.NewClient(config) sdk.SetAccessToken("YOUR-TOKEN") ``` +## Setting a Custom Timeout + +You can set a custom timeout for the SDK's HTTP requests as follows: + +```go +import "time" + +config := clientconfig.NewConfig() + +sdk := client.NewClient(config) + +sdk.SetTimeout(10 * time.Second) +``` + +# Sample Usage + +Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint: + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/user-client/client" + "github.com/magicbell/magicbell-go/pkg/user-client/util" + "github.com/magicbell/magicbell-go/pkg/user-client/channels" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +params := channels.ListInboxTokensRequestParams{ + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), +} + +response, err := client.Channels.ListInboxTokens(context.Background(), params) +if err != nil { + panic(err) +} + +fmt.Println(response) + +``` + ## Services The SDK provides various services to interact with the API. -
+
Below is a list of all available services with links to their detailed documentation: | Name | @@ -104,38 +161,41 @@ This struct is shared by both response wrappers and contains the following field The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently. -
+
Below is a list of all available models with links to their detailed documentation: | Name | Description | | :----------------------------------------------------------------------------------------------- | :---------- | | [InboxTokenResponseCollection](models/inbox_token_response_collection.md) | | -| [InboxToken](models/inbox_token.md) | | | [InboxTokenResponse](models/inbox_token_response.md) | | +| [Links](models/links.md) | | +| [InboxToken](models/inbox_token.md) | | | [DiscardResult](models/discard_result.md) | | | [ApnsTokenCollection](models/apns_token_collection.md) | | -| [ApnsTokenPayload](models/apns_token_payload.md) | | | [ApnsToken](models/apns_token.md) | | +| [ApnsTokenPayload](models/apns_token_payload.md) | | | [ExpoTokenCollection](models/expo_token_collection.md) | | -| [ExpoTokenPayload](models/expo_token_payload.md) | | | [ExpoToken](models/expo_token.md) | | +| [ExpoTokenPayload](models/expo_token_payload.md) | | | [FcmTokenCollection](models/fcm_token_collection.md) | | -| [FcmTokenPayload](models/fcm_token_payload.md) | | | [FcmToken](models/fcm_token.md) | | +| [FcmTokenPayload](models/fcm_token_payload.md) | | | [SlackTokenCollection](models/slack_token_collection.md) | | -| [SlackTokenPayload](models/slack_token_payload.md) | | | [SlackToken](models/slack_token.md) | | +| [SlackTokenPayload](models/slack_token_payload.md) | | | [TeamsTokenCollection](models/teams_token_collection.md) | | -| [TeamsTokenPayload](models/teams_token_payload.md) | | | [TeamsToken](models/teams_token.md) | | +| [TeamsTokenPayload](models/teams_token_payload.md) | | +| [UserPreferences](models/user_preferences.md) | | | [WebPushTokenCollection](models/web_push_token_collection.md) | | -| [WebPushTokenPayload](models/web_push_token_payload.md) | | | [WebPushToken](models/web_push_token.md) | | +| [WebPushTokenPayload](models/web_push_token_payload.md) | | | [InboxConfigPayload](models/inbox_config_payload.md) | | | [SlackInstallation](models/slack_installation.md) | | | [SlackFinishInstallResponse](models/slack_finish_install_response.md) | | | [SlackStartInstall](models/slack_start_install.md) | | | [SlackStartInstallResponseContent](models/slack_start_install_response_content.md) | | +| [WebPushTokenPayload](models/web_push_token_payload.md) | | | [WebPushStartInstallationResponse](models/web_push_start_installation_response.md) | | | [NotificationCollection](models/notification_collection.md) | | | [Notification](models/notification.md) | | diff --git a/docs/user-client/models/apns_token.md b/docs/user-client/models/apns_token.md index 3b649d8..93bf1af 100644 --- a/docs/user-client/models/apns_token.md +++ b/docs/user-client/models/apns_token.md @@ -20,5 +20,5 @@ | Name | Type | Required | Description | | :---------- | :----- | :------- | :------------ | -| development | string | ✅ | "development" | -| production | string | ✅ | "production" | +| Development | string | ✅ | "development" | +| Production | string | ✅ | "production" | diff --git a/docs/user-client/models/apns_token_collection.md b/docs/user-client/models/apns_token_collection.md index 0b26eb2..b8638ba 100644 --- a/docs/user-client/models/apns_token_collection.md +++ b/docs/user-client/models/apns_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------- | :------- | :---------- | -| Data | []channels.ApnsToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------ | :------- | :---------- | +| Data | [][channels.ApnsToken](apns_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/apns_token_payload.md b/docs/user-client/models/apns_token_payload.md index eed0627..4f97231 100644 --- a/docs/user-client/models/apns_token_payload.md +++ b/docs/user-client/models/apns_token_payload.md @@ -16,5 +16,5 @@ | Name | Type | Required | Description | | :---------- | :----- | :------- | :------------ | -| development | string | ✅ | "development" | -| production | string | ✅ | "production" | +| Development | string | ✅ | "development" | +| Production | string | ✅ | "production" | diff --git a/docs/user-client/models/expo_token_collection.md b/docs/user-client/models/expo_token_collection.md index 016b17e..86aa56b 100644 --- a/docs/user-client/models/expo_token_collection.md +++ b/docs/user-client/models/expo_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------- | :------- | :---------- | -| Data | []channels.ExpoToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------ | :------- | :---------- | +| Data | [][channels.ExpoToken](expo_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/fcm_token.md b/docs/user-client/models/fcm_token.md index 159a1df..e5f4d96 100644 --- a/docs/user-client/models/fcm_token.md +++ b/docs/user-client/models/fcm_token.md @@ -17,5 +17,5 @@ | Name | Type | Required | Description | | :---------- | :----- | :------- | :------------ | -| development | string | ✅ | "development" | -| production | string | ✅ | "production" | +| Development | string | ✅ | "development" | +| Production | string | ✅ | "production" | diff --git a/docs/user-client/models/fcm_token_collection.md b/docs/user-client/models/fcm_token_collection.md index 234da3f..0a2f5cd 100644 --- a/docs/user-client/models/fcm_token_collection.md +++ b/docs/user-client/models/fcm_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------ | :------- | :---------- | -| Data | []channels.FcmToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------- | :------- | :---------- | +| Data | [][channels.FcmToken](fcm_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/fcm_token_payload.md b/docs/user-client/models/fcm_token_payload.md index 2ed01f1..e061529 100644 --- a/docs/user-client/models/fcm_token_payload.md +++ b/docs/user-client/models/fcm_token_payload.md @@ -13,5 +13,5 @@ | Name | Type | Required | Description | | :---------- | :----- | :------- | :------------ | -| development | string | ✅ | "development" | -| production | string | ✅ | "production" | +| Development | string | ✅ | "development" | +| Production | string | ✅ | "production" | diff --git a/docs/user-client/models/inbox_token_response_collection.md b/docs/user-client/models/inbox_token_response_collection.md index b3bb125..cf5a84b 100644 --- a/docs/user-client/models/inbox_token_response_collection.md +++ b/docs/user-client/models/inbox_token_response_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :---------------------------- | :------- | :---------- | -| Data | []channels.InboxTokenResponse | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------------------- | :------- | :---------- | +| Data | [][channels.InboxTokenResponse](inbox_token_response.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/notification_collection.md b/docs/user-client/models/notification_collection.md index 8946557..fd1698e 100644 --- a/docs/user-client/models/notification_collection.md +++ b/docs/user-client/models/notification_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :--------------------------- | :------- | :---------- | -| Data | []notifications.Notification | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :---------------------------------------------- | :------- | :---------- | +| Data | [][notifications.Notification](notification.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/slack_token_collection.md b/docs/user-client/models/slack_token_collection.md index f8d5581..cb50f05 100644 --- a/docs/user-client/models/slack_token_collection.md +++ b/docs/user-client/models/slack_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------- | :------- | :---------- | -| Data | []channels.SlackToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------- | :------- | :---------- | +| Data | [][channels.SlackToken](slack_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/teams_token_collection.md b/docs/user-client/models/teams_token_collection.md index 1ca3537..b837dca 100644 --- a/docs/user-client/models/teams_token_collection.md +++ b/docs/user-client/models/teams_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------- | :------- | :---------- | -| Data | []channels.TeamsToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :-------------------------------------- | :------- | :---------- | +| Data | [][channels.TeamsToken](teams_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/models/user_preferences.md b/docs/user-client/models/user_preferences.md new file mode 100644 index 0000000..82a699a --- /dev/null +++ b/docs/user-client/models/user_preferences.md @@ -0,0 +1,26 @@ +# UserPreferences + +**Properties** + +| Name | Type | Required | Description | +| :--------- | :-------------------- | :------- | :---------- | +| Categories | []channels.Categories | ❌ | | + +# Categories + +**Properties** + +| Name | Type | Required | Description | +| :------- | :------------------ | :------- | :---------- | +| Channels | []channels.Channels | ❌ | | +| Key | string | ❌ | | +| Label | string | ❌ | | + +# Channels + +**Properties** + +| Name | Type | Required | Description | +| :------ | :----- | :------- | :---------- | +| Enabled | bool | ❌ | | +| Name | string | ❌ | | diff --git a/docs/user-client/models/web_push_token_collection.md b/docs/user-client/models/web_push_token_collection.md index ed16554..6446fe5 100644 --- a/docs/user-client/models/web_push_token_collection.md +++ b/docs/user-client/models/web_push_token_collection.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :---------------------- | :------- | :---------- | -| Data | []channels.WebPushToken | ❌ | | -| Links | shared.Links | ❌ | | +| Name | Type | Required | Description | +| :---- | :------------------------------------------- | :------- | :---------- | +| Data | [][channels.WebPushToken](web_push_token.md) | ❌ | | +| Links | [shared.Links](links.md) | ❌ | | diff --git a/docs/user-client/services/channels_service.md b/docs/user-client/services/channels_service.md index 433fa2f..10400b3 100644 --- a/docs/user-client/services/channels_service.md +++ b/docs/user-client/services/channels_service.md @@ -2,36 +2,38 @@ A list of all methods in the `ChannelsService` service. Click on the method name to view detailed information about that method. -| Methods | Description | -| :---------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [ListInboxTokens](#listinboxtokens) | Lists all Inbox tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveInboxToken](#saveinboxtoken) | Saves the Inbox token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchInboxToken](#fetchinboxtoken) | Fetches details of a specific Inbox token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteInboxToken](#deleteinboxtoken) | Deletes one of the authenticated user's Inbox tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | -| [ListApnsTokens](#listapnstokens) | Lists all APNs tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveApnsToken](#saveapnstoken) | Saves the APNs token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchApnsToken](#fetchapnstoken) | Fetches details of a specific APNs token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteApnsToken](#deleteapnstoken) | Deletes one of the authenticated user's APNs tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | -| [ListExpoTokens](#listexpotokens) | Lists all Expo tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveExpoToken](#saveexpotoken) | Saves the Expo token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchExpoToken](#fetchexpotoken) | Fetches details of a specific Expo token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteExpoToken](#deleteexpotoken) | Deletes one of the authenticated user's Expo tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | -| [ListFcmTokens](#listfcmtokens) | Lists all FCM tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveFcmToken](#savefcmtoken) | Saves the FCM token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchFcmToken](#fetchfcmtoken) | Fetches details of a specific FCM token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteFcmToken](#deletefcmtoken) | Deletes one of the authenticated user's FCM tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | -| [ListSlackTokens](#listslacktokens) | Lists all Slack tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveSlackToken](#saveslacktoken) | Saves the Slack token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchSlackToken](#fetchslacktoken) | Fetches details of a specific Slack token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteSlackToken](#deleteslacktoken) | Deletes one of the authenticated user's Slack tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | -| [ListTeamsTokens](#listteamstokens) | Lists all Teams tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveTeamsToken](#saveteamstoken) | Saves the Teams token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchTeamsToken](#fetchteamstoken) | Fetches details of a specific Teams token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteTeamsToken](#deleteteamstoken) | Deletes one of the authenticated user's Teams tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | -| [ListWebPushTokens](#listwebpushtokens) | Lists all Web Push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | -| [SaveWebPushToken](#savewebpushtoken) | Saves the Web Push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | -| [FetchWebPushToken](#fetchwebpushtoken) | Fetches details of a specific Web Push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | -| [DeleteWebPushToken](#deletewebpushtoken) | Deletes one of the authenticated user's Web Push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| Methods | Description | +| :-------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [ListInboxTokens](#listinboxtokens) | Lists all Inbox tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveInboxToken](#saveinboxtoken) | Saves the Inbox token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchInboxToken](#fetchinboxtoken) | Fetches details of a specific Inbox token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteInboxToken](#deleteinboxtoken) | Deletes one of the authenticated user's Inbox tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| [ListApnsTokens](#listapnstokens) | Lists all APNs tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveApnsToken](#saveapnstoken) | Saves the APNs token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchApnsToken](#fetchapnstoken) | Fetches details of a specific APNs token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteApnsToken](#deleteapnstoken) | Deletes one of the authenticated user's APNs tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| [ListExpoTokens](#listexpotokens) | Lists all Expo tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveExpoToken](#saveexpotoken) | Saves the Expo token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchExpoToken](#fetchexpotoken) | Fetches details of a specific Expo token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteExpoToken](#deleteexpotoken) | Deletes one of the authenticated user's Expo tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| [ListFcmTokens](#listfcmtokens) | Lists all FCM tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveFcmToken](#savefcmtoken) | Saves the FCM token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchFcmToken](#fetchfcmtoken) | Fetches details of a specific FCM token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteFcmToken](#deletefcmtoken) | Deletes one of the authenticated user's FCM tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| [ListSlackTokens](#listslacktokens) | Lists all Slack tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveSlackToken](#saveslacktoken) | Saves the Slack token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchSlackToken](#fetchslacktoken) | Fetches details of a specific Slack token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteSlackToken](#deleteslacktoken) | Deletes one of the authenticated user's Slack tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| [ListTeamsTokens](#listteamstokens) | Lists all Teams tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveTeamsToken](#saveteamstoken) | Saves the Teams token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchTeamsToken](#fetchteamstoken) | Fetches details of a specific Teams token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteTeamsToken](#deleteteamstoken) | Deletes one of the authenticated user's Teams tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | +| [FetchUserPreferences](#fetchuserpreferences) | Fetch a user's channel delivery preferences. | +| [SaveUserPreferences](#saveuserpreferences) | Save a user's channel preferences. | +| [ListWebPushTokens](#listwebpushtokens) | Lists all Web Push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. | +| [SaveWebPushToken](#savewebpushtoken) | Saves the Web Push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel. | +| [FetchWebPushToken](#fetchwebpushtoken) | Fetches details of a specific Web Push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens. | +| [DeleteWebPushToken](#deletewebpushtoken) | Deletes one of the authenticated user's Web Push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens. | ## ListInboxTokens @@ -57,18 +59,22 @@ Lists all Inbox tokens belonging to the authenticated user. Returns a paginated import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListInboxTokensRequestParams{ - + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListInboxTokens(context.Background(), params) @@ -103,6 +109,7 @@ Saves the Inbox token for the authenticated user. This token serves as a credent import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -110,12 +117,13 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := channels.InboxToken{ - ConnectionId: util.ToPointer(util.Nullable[string]{ Value: "ConnectionId" }), - Token: util.ToPointer("Token"), + ConnectionId: util.ToPointer(util.Nullable[string]{ Value: "connection_id" }), + Token: util.ToPointer("ipsum nulla mag"), } response, err := client.Channels.SaveInboxToken(context.Background(), request) @@ -150,15 +158,17 @@ Fetches details of a specific Inbox token belonging to the authenticated user. R import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchInboxToken(context.Background(), "tokenId") +response, err := client.Channels.FetchInboxToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -190,15 +200,17 @@ Deletes one of the authenticated user's Inbox tokens. This permanently invalidat import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteInboxToken(context.Background(), "tokenId") +response, err := client.Channels.DeleteInboxToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -230,18 +242,22 @@ Lists all APNs tokens belonging to the authenticated user. Returns a paginated l import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListApnsTokensRequestParams{ - + Limit: util.ToPointer(int64(7)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListApnsTokens(context.Background(), params) @@ -276,6 +292,7 @@ Saves the APNs token for the authenticated user. This token serves as a credenti import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -283,13 +300,14 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) apnsTokenPayloadInstallationId := channels.APNS_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT request := channels.ApnsTokenPayload{ - AppId: util.ToPointer("AppId"), - DeviceToken: util.ToPointer("DeviceToken"), + AppId: util.ToPointer("app_id"), + DeviceToken: util.ToPointer("sit culpa incid"), InstallationId: &apnsTokenPayloadInstallationId, } @@ -325,15 +343,17 @@ Fetches details of a specific APNs token belonging to the authenticated user. Re import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchApnsToken(context.Background(), "tokenId") +response, err := client.Channels.FetchApnsToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -365,15 +385,17 @@ Deletes one of the authenticated user's APNs tokens. This permanently invalidate import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteApnsToken(context.Background(), "tokenId") +response, err := client.Channels.DeleteApnsToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -405,18 +427,22 @@ Lists all Expo tokens belonging to the authenticated user. Returns a paginated l import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListExpoTokensRequestParams{ - + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListExpoTokens(context.Background(), params) @@ -451,6 +477,7 @@ Saves the Expo token for the authenticated user. This token serves as a credenti import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -458,11 +485,12 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := channels.ExpoTokenPayload{ - DeviceToken: util.ToPointer("DeviceToken"), + DeviceToken: util.ToPointer("device_token"), } response, err := client.Channels.SaveExpoToken(context.Background(), request) @@ -497,15 +525,17 @@ Fetches details of a specific Expo token belonging to the authenticated user. Re import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchExpoToken(context.Background(), "tokenId") +response, err := client.Channels.FetchExpoToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -537,15 +567,17 @@ Deletes one of the authenticated user's Expo tokens. This permanently invalidate import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteExpoToken(context.Background(), "tokenId") +response, err := client.Channels.DeleteExpoToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -577,18 +609,22 @@ Lists all FCM tokens belonging to the authenticated user. Returns a paginated li import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListFcmTokensRequestParams{ - + Limit: util.ToPointer(int64(6)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListFcmTokens(context.Background(), params) @@ -623,6 +659,7 @@ Saves the FCM token for the authenticated user. This token serves as a credentia import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -630,12 +667,13 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) fcmTokenPayloadInstallationId := channels.FCM_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT request := channels.FcmTokenPayload{ - DeviceToken: util.ToPointer("DeviceToken"), + DeviceToken: util.ToPointer("estminim adipis"), InstallationId: &fcmTokenPayloadInstallationId, } @@ -671,15 +709,17 @@ Fetches details of a specific FCM token belonging to the authenticated user. Ret import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchFcmToken(context.Background(), "tokenId") +response, err := client.Channels.FetchFcmToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -711,15 +751,17 @@ Deletes one of the authenticated user's FCM tokens. This permanently invalidates import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteFcmToken(context.Background(), "tokenId") +response, err := client.Channels.DeleteFcmToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -751,18 +793,22 @@ Lists all Slack tokens belonging to the authenticated user. Returns a paginated import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListSlackTokensRequestParams{ - + Limit: util.ToPointer(int64(7)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListSlackTokens(context.Background(), params) @@ -797,6 +843,7 @@ Saves the Slack token for the authenticated user. This token serves as a credent import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -804,18 +851,19 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) slackTokenPayloadOauth := channels.SlackTokenPayloadOauth{ - ChannelId: util.ToPointer("ChannelId"), - InstallationId: util.ToPointer("InstallationId"), - Scope: util.ToPointer("Scope"), + ChannelId: util.ToPointer("channel_id"), + InstallationId: util.ToPointer("installation_id"), + Scope: util.ToPointer("scope"), } slackTokenPayloadWebhook := channels.SlackTokenPayloadWebhook{ - Url: util.ToPointer("Url"), + Url: util.ToPointer("url"), } request := channels.SlackTokenPayload{ @@ -855,15 +903,17 @@ Fetches details of a specific Slack token belonging to the authenticated user. R import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchSlackToken(context.Background(), "tokenId") +response, err := client.Channels.FetchSlackToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -895,15 +945,17 @@ Deletes one of the authenticated user's Slack tokens. This permanently invalidat import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteSlackToken(context.Background(), "tokenId") +response, err := client.Channels.DeleteSlackToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -935,18 +987,22 @@ Lists all Teams tokens belonging to the authenticated user. Returns a paginated import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListTeamsTokensRequestParams{ - + Limit: util.ToPointer(int64(2)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListTeamsTokens(context.Background(), params) @@ -981,6 +1037,7 @@ Saves the Teams token for the authenticated user. This token serves as a credent import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -988,11 +1045,12 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) teamsTokenPayloadWebhook := channels.TeamsTokenPayloadWebhook{ - Url: util.ToPointer("Url"), + Url: util.ToPointer("url"), } request := channels.TeamsTokenPayload{ @@ -1031,15 +1089,17 @@ Fetches details of a specific Teams token belonging to the authenticated user. R import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchTeamsToken(context.Background(), "tokenId") +response, err := client.Channels.FetchTeamsToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -1071,15 +1131,117 @@ Deletes one of the authenticated user's Teams tokens. This permanently invalidat import ( "fmt" "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/user-client/client" + +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + +response, err := client.Channels.DeleteTeamsToken(context.Background(), "token_id") +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## FetchUserPreferences + +Fetch a user's channel delivery preferences. + +- HTTP Method: `GET` +- Endpoint: `/channels/user_preferences` + +**Parameters** + +| Name | Type | Required | Description | +| :--- | :------ | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | + +**Return Type** + +`UserPreferences` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteTeamsToken(context.Background(), "tokenId") +response, err := client.Channels.FetchUserPreferences(context.Background()) +if err != nil { + panic(err) +} + +fmt.Println(response) +``` + +## SaveUserPreferences + +Save a user's channel preferences. + +- HTTP Method: `PUT` +- Endpoint: `/channels/user_preferences` + +**Parameters** + +| Name | Type | Required | Description | +| :-------------- | :-------------- | :------- | :-------------------------- | +| ctx | Context | ✅ | Default go language context | +| userPreferences | UserPreferences | ✅ | | + +**Return Type** + +`any` + +**Example Usage Code Snippet** + +```go +import ( + "fmt" + "encoding/json" + "context" + "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/user-client/client" + "github.com/magicbell/magicbell-go/pkg/user-client/util" + "github.com/magicbell/magicbell-go/pkg/user-client/channels" +) + +config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") +client := client.NewClient(config) + + +channels := channels.Channels{ + Enabled: util.ToPointer(true), + Name: util.ToPointer("name"), +} + +categories := channels.Categories{ + Channels: []channels.Channels{channels}, + Key: util.ToPointer("key"), + Label: util.ToPointer(util.Nullable[string]{ Value: "label" }), +} + +request := channels.UserPreferences{ + Categories: []channels.Categories{categories}, +} + +response, err := client.Channels.SaveUserPreferences(context.Background(), request) if err != nil { panic(err) } @@ -1111,18 +1273,22 @@ Lists all Web Push tokens belonging to the authenticated user. Returns a paginat import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/channels" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := channels.ListWebPushTokensRequestParams{ - + Limit: util.ToPointer(int64(7)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), } response, err := client.Channels.ListWebPushTokens(context.Background(), params) @@ -1157,6 +1323,7 @@ Saves the Web Push token for the authenticated user. This token serves as a cred import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -1164,16 +1331,17 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) webPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{ - Auth: util.ToPointer("Auth"), - P256dh: util.ToPointer("P256dh"), + Auth: util.ToPointer("auth"), + P256dh: util.ToPointer("p256dh"), } request := shared.WebPushTokenPayload{ - Endpoint: util.ToPointer("Endpoint"), + Endpoint: util.ToPointer("endpoint"), Keys: &webPushTokenPayloadKeys, } @@ -1209,15 +1377,17 @@ Fetches details of a specific Web Push token belonging to the authenticated user import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.FetchWebPushToken(context.Background(), "tokenId") +response, err := client.Channels.FetchWebPushToken(context.Background(), "token_id") if err != nil { panic(err) } @@ -1249,15 +1419,17 @@ Deletes one of the authenticated user's Web Push tokens. This permanently invali import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Channels.DeleteWebPushToken(context.Background(), "tokenId") +response, err := client.Channels.DeleteWebPushToken(context.Background(), "token_id") if err != nil { panic(err) } diff --git a/docs/user-client/services/integrations_service.md b/docs/user-client/services/integrations_service.md index 64b2b2b..790d681 100644 --- a/docs/user-client/services/integrations_service.md +++ b/docs/user-client/services/integrations_service.md @@ -36,6 +36,7 @@ Creates a new installation of a Inbox integration for a user. This endpoint is u import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -43,104 +44,105 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) images := integrations.Images{ - EmptyInboxUrl: util.ToPointer("EmptyInboxUrl"), + EmptyInboxUrl: util.ToPointer("emptyInboxUrl"), } banner := integrations.Banner{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BackgroundOpacity: util.ToPointer(float64(123)), - FontSize: util.ToPointer("FontSize"), - TextColor: util.ToPointer("TextColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + BackgroundOpacity: util.ToPointer(float64(8.76)), + FontSize: util.ToPointer("fontSize"), + TextColor: util.ToPointer("textColor"), } dialog := integrations.Dialog{ - AccentColor: util.ToPointer("AccentColor"), - BackgroundColor: util.ToPointer("BackgroundColor"), - TextColor: util.ToPointer("TextColor"), + AccentColor: util.ToPointer("accentColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + TextColor: util.ToPointer("textColor"), } footer := integrations.Footer{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BorderRadius: util.ToPointer("BorderRadius"), - FontSize: util.ToPointer("FontSize"), - TextColor: util.ToPointer("TextColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + BorderRadius: util.ToPointer("borderRadius"), + FontSize: util.ToPointer("fontSize"), + TextColor: util.ToPointer("textColor"), } header := integrations.Header{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BorderRadius: util.ToPointer("BorderRadius"), - FontFamily: util.ToPointer("FontFamily"), - FontSize: util.ToPointer("FontSize"), - TextColor: util.ToPointer("TextColor"), + BackgroundColor: util.ToPointer("backgroundColor"), + BorderRadius: util.ToPointer("borderRadius"), + FontFamily: util.ToPointer("fontFamily"), + FontSize: util.ToPointer("fontSize"), + TextColor: util.ToPointer("textColor"), } icon := integrations.Icon{ - BorderColor: util.ToPointer("BorderColor"), - Width: util.ToPointer("Width"), + BorderColor: util.ToPointer("borderColor"), + Width: util.ToPointer("width"), } defaultHover := integrations.DefaultHover{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } defaultState := integrations.DefaultState{ - Color: util.ToPointer("Color"), + Color: util.ToPointer("color"), } default_ := integrations.Default_{ - BackgroundColor: util.ToPointer("BackgroundColor"), - BorderRadius: util.ToPointer("BorderRadius"), - FontFamily: util.ToPointer("FontFamily"), - FontSize: util.ToPointer("FontSize"), + BackgroundColor: util.ToPointer("backgroundColor"), + BorderRadius: util.ToPointer("borderRadius"), + FontFamily: util.ToPointer("fontFamily"), + FontSize: util.ToPointer("fontSize"), Hover: &defaultHover, - Margin: util.ToPointer("Margin"), + Margin: util.ToPointer("margin"), State: &defaultState, - TextColor: util.ToPointer("TextColor"), + TextColor: util.ToPointer("textColor"), } unreadHover := integrations.UnreadHover{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } unreadState := integrations.UnreadState{ - Color: util.ToPointer("Color"), + Color: util.ToPointer("color"), } unread := integrations.Unread{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), Hover: &unreadHover, State: &unreadState, - TextColor: util.ToPointer("TextColor"), + TextColor: util.ToPointer("textColor"), } unseenHover := integrations.UnseenHover{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } unseenState := integrations.UnseenState{ - Color: util.ToPointer("Color"), + Color: util.ToPointer("color"), } unseen := integrations.Unseen{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), Hover: &unseenHover, State: &unseenState, - TextColor: util.ToPointer("TextColor"), + TextColor: util.ToPointer("textColor"), } themeNotification := integrations.ThemeNotification{ @@ -151,7 +153,7 @@ themeNotification := integrations.ThemeNotification{ unseenBadge := integrations.UnseenBadge{ - BackgroundColor: util.ToPointer("BackgroundColor"), + BackgroundColor: util.ToPointer("backgroundColor"), } theme := integrations.Theme{ @@ -166,7 +168,7 @@ theme := integrations.Theme{ request := integrations.InboxConfigPayload{ Images: &images, - Locale: util.ToPointer(util.Nullable[string]{ Value: "Locale" }), + Locale: util.ToPointer(util.Nullable[string]{ Value: "locale" }), Theme: &theme, } @@ -201,12 +203,14 @@ Initiates the installation flow for an Inbox integration. This is the first step import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.StartInboxInstallation(context.Background()) @@ -241,6 +245,7 @@ Creates a new installation of a Slack integration for a user. This endpoint is u import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -248,51 +253,52 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) authedUser := integrations.AuthedUser{ - AccessToken: util.ToPointer("AccessToken"), - ExpiresIn: util.ToPointer(int64(123)), - Id: util.ToPointer("Id"), - RefreshToken: util.ToPointer("RefreshToken"), - Scope: util.ToPointer("Scope"), - TokenType: util.ToPointer("TokenType"), + AccessToken: util.ToPointer("access_token"), + ExpiresIn: util.ToPointer(int64(7)), + Id: util.ToPointer("id"), + RefreshToken: util.ToPointer("refresh_token"), + Scope: util.ToPointer("scope"), + TokenType: util.ToPointer("token_type"), } enterprise := integrations.Enterprise{ - Id: util.ToPointer("Id"), - Name: util.ToPointer("Name"), + Id: util.ToPointer("id"), + Name: util.ToPointer("name"), } incomingWebhook := integrations.IncomingWebhook{ - Channel: util.ToPointer("Channel"), - ConfigurationUrl: util.ToPointer("ConfigurationUrl"), - Url: util.ToPointer("Url"), + Channel: util.ToPointer("channel"), + ConfigurationUrl: util.ToPointer("configuration_url"), + Url: util.ToPointer("url"), } team := integrations.Team{ - Id: util.ToPointer("Id"), - Name: util.ToPointer("Name"), + Id: util.ToPointer("id"), + Name: util.ToPointer("name"), } request := integrations.SlackInstallation{ - AccessToken: util.ToPointer("AccessToken"), - AppId: util.ToPointer("AppId"), + AccessToken: util.ToPointer("access_token"), + AppId: util.ToPointer("app_id"), AuthedUser: &authedUser, - BotUserId: util.ToPointer("BotUserId"), + BotUserId: util.ToPointer("bot_user_id"), Enterprise: &enterprise, - ExpiresIn: util.ToPointer(int64(123)), - Id: util.ToPointer("Id"), + ExpiresIn: util.ToPointer(int64(1)), + Id: util.ToPointer("H31-[g~J]11NRM"), IncomingWebhook: &incomingWebhook, IsEnterpriseInstall: util.ToPointer(true), - RefreshToken: util.ToPointer("RefreshToken"), - Scope: util.ToPointer("Scope"), + RefreshToken: util.ToPointer("refresh_token"), + Scope: util.ToPointer("scope"), Team: &team, - TokenType: util.ToPointer("TokenType"), + TokenType: util.ToPointer("token_type"), } response, err := client.Integrations.SaveSlackInstallation(context.Background(), request) @@ -327,6 +333,7 @@ Completes the installation flow for the Slack integration. This endpoint is typi import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -334,13 +341,14 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.SlackFinishInstallResponse{ - AppId: util.ToPointer("AppId"), - Code: util.ToPointer("Code"), - RedirectUrl: util.ToPointer("RedirectUrl"), + AppId: util.ToPointer("app_id"), + Code: util.ToPointer("code"), + RedirectUrl: util.ToPointer("redirect_url"), } response, err := client.Integrations.FinishSlackInstallation(context.Background(), request) @@ -375,6 +383,7 @@ Initiates the installation flow for a Slack integration. This is the first step import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -382,14 +391,15 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) request := integrations.SlackStartInstall{ - AppId: util.ToPointer("AppId"), - AuthUrl: util.ToPointer("AuthUrl"), + AppId: util.ToPointer("app_id"), + AuthUrl: util.ToPointer("auth_url"), ExtraScopes: []string{}, - RedirectUrl: util.ToPointer("RedirectUrl"), + RedirectUrl: util.ToPointer("redirect_url"), } response, err := client.Integrations.StartSlackInstallation(context.Background(), request) @@ -424,6 +434,7 @@ Creates a new installation of a Web Push integration for a user. This endpoint i import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" "github.com/magicbell/magicbell-go/pkg/user-client/util" @@ -431,16 +442,17 @@ import ( ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) webPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{ - Auth: util.ToPointer("Auth"), - P256dh: util.ToPointer("P256dh"), + Auth: util.ToPointer("auth"), + P256dh: util.ToPointer("p256dh"), } request := shared.WebPushTokenPayload{ - Endpoint: util.ToPointer("Endpoint"), + Endpoint: util.ToPointer("endpoint"), Keys: &webPushTokenPayloadKeys, } @@ -475,12 +487,14 @@ Initiates the installation flow for a Web Push integration. This is the first st import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) response, err := client.Integrations.StartWebPushInstallation(context.Background()) diff --git a/docs/user-client/services/notifications_service.md b/docs/user-client/services/notifications_service.md index db7e969..b62f437 100644 --- a/docs/user-client/services/notifications_service.md +++ b/docs/user-client/services/notifications_service.md @@ -37,18 +37,25 @@ Lists all notifications for a user. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/notifications" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := notifications.ListNotificationsRequestParams{ - + Limit: util.ToPointer(int64(8)), + StartingAfter: util.ToPointer("starting_after"), + EndingBefore: util.ToPointer("ending_before"), + Status: util.ToPointer("status"), + Category: util.ToPointer("category"), + Topic: util.ToPointer("topic"), } response, err := client.Notifications.ListNotifications(context.Background(), params) @@ -83,18 +90,21 @@ Archive all notifications. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/notifications" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := notifications.ArchiveAllNotificationsRequestParams{ - + Category: util.ToPointer("category"), + Topic: util.ToPointer("topic"), } response, err := client.Notifications.ArchiveAllNotifications(context.Background(), params) @@ -129,18 +139,21 @@ Marks all notifications as read. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" - + "github.com/magicbell/magicbell-go/pkg/user-client/util" "github.com/magicbell/magicbell-go/pkg/user-client/notifications" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) params := notifications.MarkAllNotificationsReadRequestParams{ - + Category: util.ToPointer("category"), + Topic: util.ToPointer("topic"), } response, err := client.Notifications.MarkAllNotificationsRead(context.Background(), params) @@ -175,15 +188,17 @@ Gets a notification by ID. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Notifications.FetchNotification(context.Background(), "notificationId") +response, err := client.Notifications.FetchNotification(context.Background(), "notification_id") if err != nil { panic(err) } @@ -215,15 +230,17 @@ Archive a notification. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Notifications.ArchiveNotification(context.Background(), "notificationId") +response, err := client.Notifications.ArchiveNotification(context.Background(), "notification_id") if err != nil { panic(err) } @@ -255,15 +272,17 @@ Marks a notification as read. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Notifications.MarkNotificationRead(context.Background(), "notificationId") +response, err := client.Notifications.MarkNotificationRead(context.Background(), "notification_id") if err != nil { panic(err) } @@ -295,15 +314,17 @@ Unarchives a notification. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Notifications.UnarchiveNotification(context.Background(), "notificationId") +response, err := client.Notifications.UnarchiveNotification(context.Background(), "notification_id") if err != nil { panic(err) } @@ -335,15 +356,17 @@ Marks a notification as unread. import ( "fmt" "encoding/json" + "context" "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig" "github.com/magicbell/magicbell-go/pkg/user-client/client" ) config := clientconfig.NewConfig() +config.SetAccessToken("ACCESS_TOKEN") client := client.NewClient(config) -response, err := client.Notifications.MarkNotificationUnread(context.Background(), "notificationId") +response, err := client.Notifications.MarkNotificationUnread(context.Background(), "notification_id") if err != nil { panic(err) } diff --git a/docs/user-client/snippets/snippets.json b/docs/user-client/snippets/snippets.json index c260450..f792348 100644 --- a/docs/user-client/snippets/snippets.json +++ b/docs/user-client/snippets/snippets.json @@ -1,107 +1,112 @@ { "endpoints": { "/channels/in_app/inbox/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListInboxTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListInboxTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := channels.InboxToken{\n ConnectionId: util.ToPointer(util.Nullable[string]{ Value: \"ConnectionId\" }),\n Token: util.ToPointer(\"Token\"),\n}\n\nresponse, err := client.Channels.SaveInboxToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListInboxTokensRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListInboxTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := channels.InboxToken{\n ConnectionId: util.ToPointer(util.Nullable[string]{ Value: \"connection_id\" }),\n Token: util.ToPointer(\"ipsum nulla mag\"),\n}\n\nresponse, err := client.Channels.SaveInboxToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/in_app/inbox/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchInboxToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteInboxToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchInboxToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteInboxToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/mobile_push/apns/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListApnsTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListApnsTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\napnsTokenPayloadInstallationId := channels.APNS_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT\n\nrequest := channels.ApnsTokenPayload{\n AppId: util.ToPointer(\"AppId\"),\n DeviceToken: util.ToPointer(\"DeviceToken\"),\n InstallationId: &apnsTokenPayloadInstallationId,\n}\n\nresponse, err := client.Channels.SaveApnsToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListApnsTokensRequestParams{\n Limit: util.ToPointer(int64(7)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListApnsTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\napnsTokenPayloadInstallationId := channels.APNS_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT\n\nrequest := channels.ApnsTokenPayload{\n AppId: util.ToPointer(\"app_id\"),\n DeviceToken: util.ToPointer(\"sit culpa incid\"),\n InstallationId: &apnsTokenPayloadInstallationId,\n}\n\nresponse, err := client.Channels.SaveApnsToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/mobile_push/apns/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchApnsToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteApnsToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchApnsToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteApnsToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/mobile_push/expo/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListExpoTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListExpoTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := channels.ExpoTokenPayload{\n DeviceToken: util.ToPointer(\"DeviceToken\"),\n}\n\nresponse, err := client.Channels.SaveExpoToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListExpoTokensRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListExpoTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := channels.ExpoTokenPayload{\n DeviceToken: util.ToPointer(\"device_token\"),\n}\n\nresponse, err := client.Channels.SaveExpoToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/mobile_push/expo/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchExpoToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteExpoToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchExpoToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteExpoToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/mobile_push/fcm/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListFcmTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListFcmTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nfcmTokenPayloadInstallationId := channels.FCM_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT\n\nrequest := channels.FcmTokenPayload{\n DeviceToken: util.ToPointer(\"DeviceToken\"),\n InstallationId: &fcmTokenPayloadInstallationId,\n}\n\nresponse, err := client.Channels.SaveFcmToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListFcmTokensRequestParams{\n Limit: util.ToPointer(int64(6)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListFcmTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nfcmTokenPayloadInstallationId := channels.FCM_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT\n\nrequest := channels.FcmTokenPayload{\n DeviceToken: util.ToPointer(\"estminim adipis\"),\n InstallationId: &fcmTokenPayloadInstallationId,\n}\n\nresponse, err := client.Channels.SaveFcmToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/mobile_push/fcm/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchFcmToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteFcmToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchFcmToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteFcmToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/slack/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListSlackTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListSlackTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nslackTokenPayloadOauth := channels.SlackTokenPayloadOauth{\n ChannelId: util.ToPointer(\"ChannelId\"),\n InstallationId: util.ToPointer(\"InstallationId\"),\n Scope: util.ToPointer(\"Scope\"),\n}\n\n\nslackTokenPayloadWebhook := channels.SlackTokenPayloadWebhook{\n Url: util.ToPointer(\"Url\"),\n}\n\nrequest := channels.SlackTokenPayload{\n Oauth: &slackTokenPayloadOauth,\n Webhook: &slackTokenPayloadWebhook,\n}\n\nresponse, err := client.Channels.SaveSlackToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListSlackTokensRequestParams{\n Limit: util.ToPointer(int64(7)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListSlackTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nslackTokenPayloadOauth := channels.SlackTokenPayloadOauth{\n ChannelId: util.ToPointer(\"channel_id\"),\n InstallationId: util.ToPointer(\"installation_id\"),\n Scope: util.ToPointer(\"scope\"),\n}\n\n\nslackTokenPayloadWebhook := channels.SlackTokenPayloadWebhook{\n Url: util.ToPointer(\"url\"),\n}\n\nrequest := channels.SlackTokenPayload{\n Oauth: &slackTokenPayloadOauth,\n Webhook: &slackTokenPayloadWebhook,\n}\n\nresponse, err := client.Channels.SaveSlackToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/slack/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchSlackToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteSlackToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchSlackToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteSlackToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/teams/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListTeamsTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListTeamsTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nteamsTokenPayloadWebhook := channels.TeamsTokenPayloadWebhook{\n Url: util.ToPointer(\"Url\"),\n}\n\nrequest := channels.TeamsTokenPayload{\n Webhook: &teamsTokenPayloadWebhook,\n}\n\nresponse, err := client.Channels.SaveTeamsToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListTeamsTokensRequestParams{\n Limit: util.ToPointer(int64(2)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListTeamsTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nteamsTokenPayloadWebhook := channels.TeamsTokenPayloadWebhook{\n Url: util.ToPointer(\"url\"),\n}\n\nrequest := channels.TeamsTokenPayload{\n Webhook: &teamsTokenPayloadWebhook,\n}\n\nresponse, err := client.Channels.SaveTeamsToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/teams/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchTeamsToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteTeamsToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchTeamsToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteTeamsToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + }, + "/channels/user_preferences": { + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchUserPreferences(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nchannels := channels.Channels{\n Enabled: util.ToPointer(true),\n Name: util.ToPointer(\"name\"),\n}\n\ncategories := channels.Categories{\n Channels: []channels.Channels{channels},\n Key: util.ToPointer(\"key\"),\n Label: util.ToPointer(util.Nullable[string]{ Value: \"label\" }),\n}\n\nrequest := channels.UserPreferences{\n Categories: []channels.Categories{categories},\n}\n\nresponse, err := client.Channels.SaveUserPreferences(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/web_push/tokens": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := channels.ListWebPushTokensRequestParams{\n\n}\n\nresponse, err := client.Channels.ListWebPushTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/shared\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nwebPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{\n Auth: util.ToPointer(\"Auth\"),\n P256dh: util.ToPointer(\"P256dh\"),\n}\n\nrequest := shared.WebPushTokenPayload{\n Endpoint: util.ToPointer(\"Endpoint\"),\n Keys: &webPushTokenPayloadKeys,\n}\n\nresponse, err := client.Channels.SaveWebPushToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListWebPushTokensRequestParams{\n Limit: util.ToPointer(int64(7)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListWebPushTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/shared\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nwebPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{\n Auth: util.ToPointer(\"auth\"),\n P256dh: util.ToPointer(\"p256dh\"),\n}\n\nrequest := shared.WebPushTokenPayload{\n Endpoint: util.ToPointer(\"endpoint\"),\n Keys: &webPushTokenPayloadKeys,\n}\n\nresponse, err := client.Channels.SaveWebPushToken(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/channels/web_push/tokens/{token_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchWebPushToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", - "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteWebPushToken(context.Background(), \"tokenId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.FetchWebPushToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", + "delete": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Channels.DeleteWebPushToken(context.Background(), \"token_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/inbox/installations": { - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nimages := integrations.Images{\n EmptyInboxUrl: util.ToPointer(\"EmptyInboxUrl\"),\n}\n\n\nbanner := integrations.Banner{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BackgroundOpacity: util.ToPointer(float64(123)),\n FontSize: util.ToPointer(\"FontSize\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\ndialog := integrations.Dialog{\n AccentColor: util.ToPointer(\"AccentColor\"),\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nfooter := integrations.Footer{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BorderRadius: util.ToPointer(\"BorderRadius\"),\n FontSize: util.ToPointer(\"FontSize\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nheader := integrations.Header{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BorderRadius: util.ToPointer(\"BorderRadius\"),\n FontFamily: util.ToPointer(\"FontFamily\"),\n FontSize: util.ToPointer(\"FontSize\"),\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nicon := integrations.Icon{\n BorderColor: util.ToPointer(\"BorderColor\"),\n Width: util.ToPointer(\"Width\"),\n}\n\n\ndefaultHover := integrations.DefaultHover{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\n\ndefaultState := integrations.DefaultState{\n Color: util.ToPointer(\"Color\"),\n}\n\ndefault_ := integrations.Default_{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n BorderRadius: util.ToPointer(\"BorderRadius\"),\n FontFamily: util.ToPointer(\"FontFamily\"),\n FontSize: util.ToPointer(\"FontSize\"),\n Hover: &defaultHover,\n Margin: util.ToPointer(\"Margin\"),\n State: &defaultState,\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nunreadHover := integrations.UnreadHover{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\n\nunreadState := integrations.UnreadState{\n Color: util.ToPointer(\"Color\"),\n}\n\nunread := integrations.Unread{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n Hover: &unreadHover,\n State: &unreadState,\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\n\nunseenHover := integrations.UnseenHover{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\n\nunseenState := integrations.UnseenState{\n Color: util.ToPointer(\"Color\"),\n}\n\nunseen := integrations.Unseen{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n Hover: &unseenHover,\n State: &unseenState,\n TextColor: util.ToPointer(\"TextColor\"),\n}\n\nthemeNotification := integrations.ThemeNotification{\n Default_: &default_,\n Unread: &unread,\n Unseen: &unseen,\n}\n\n\nunseenBadge := integrations.UnseenBadge{\n BackgroundColor: util.ToPointer(\"BackgroundColor\"),\n}\n\ntheme := integrations.Theme{\n Banner: &banner,\n Dialog: &dialog,\n Footer: &footer,\n Header: &header,\n Icon: &icon,\n Notification: &themeNotification,\n UnseenBadge: &unseenBadge,\n}\n\nrequest := integrations.InboxConfigPayload{\n Images: &images,\n Locale: util.ToPointer(util.Nullable[string]{ Value: \"Locale\" }),\n Theme: &theme,\n}\n\nresponse, err := client.Integrations.SaveInboxInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nimages := integrations.Images{\n EmptyInboxUrl: util.ToPointer(\"emptyInboxUrl\"),\n}\n\n\nbanner := integrations.Banner{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BackgroundOpacity: util.ToPointer(float64(8.76)),\n FontSize: util.ToPointer(\"fontSize\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\ndialog := integrations.Dialog{\n AccentColor: util.ToPointer(\"accentColor\"),\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nfooter := integrations.Footer{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BorderRadius: util.ToPointer(\"borderRadius\"),\n FontSize: util.ToPointer(\"fontSize\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nheader := integrations.Header{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BorderRadius: util.ToPointer(\"borderRadius\"),\n FontFamily: util.ToPointer(\"fontFamily\"),\n FontSize: util.ToPointer(\"fontSize\"),\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nicon := integrations.Icon{\n BorderColor: util.ToPointer(\"borderColor\"),\n Width: util.ToPointer(\"width\"),\n}\n\n\ndefaultHover := integrations.DefaultHover{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\n\ndefaultState := integrations.DefaultState{\n Color: util.ToPointer(\"color\"),\n}\n\ndefault_ := integrations.Default_{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n BorderRadius: util.ToPointer(\"borderRadius\"),\n FontFamily: util.ToPointer(\"fontFamily\"),\n FontSize: util.ToPointer(\"fontSize\"),\n Hover: &defaultHover,\n Margin: util.ToPointer(\"margin\"),\n State: &defaultState,\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nunreadHover := integrations.UnreadHover{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\n\nunreadState := integrations.UnreadState{\n Color: util.ToPointer(\"color\"),\n}\n\nunread := integrations.Unread{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n Hover: &unreadHover,\n State: &unreadState,\n TextColor: util.ToPointer(\"textColor\"),\n}\n\n\nunseenHover := integrations.UnseenHover{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\n\nunseenState := integrations.UnseenState{\n Color: util.ToPointer(\"color\"),\n}\n\nunseen := integrations.Unseen{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n Hover: &unseenHover,\n State: &unseenState,\n TextColor: util.ToPointer(\"textColor\"),\n}\n\nthemeNotification := integrations.ThemeNotification{\n Default_: &default_,\n Unread: &unread,\n Unseen: &unseen,\n}\n\n\nunseenBadge := integrations.UnseenBadge{\n BackgroundColor: util.ToPointer(\"backgroundColor\"),\n}\n\ntheme := integrations.Theme{\n Banner: &banner,\n Dialog: &dialog,\n Footer: &footer,\n Header: &header,\n Icon: &icon,\n Notification: &themeNotification,\n UnseenBadge: &unseenBadge,\n}\n\nrequest := integrations.InboxConfigPayload{\n Images: &images,\n Locale: util.ToPointer(util.Nullable[string]{ Value: \"locale\" }),\n Theme: &theme,\n}\n\nresponse, err := client.Integrations.SaveInboxInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/inbox/installations/start": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.StartInboxInstallation(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.StartInboxInstallation(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/slack/installations": { - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nauthedUser := integrations.AuthedUser{\n AccessToken: util.ToPointer(\"AccessToken\"),\n ExpiresIn: util.ToPointer(int64(123)),\n Id: util.ToPointer(\"Id\"),\n RefreshToken: util.ToPointer(\"RefreshToken\"),\n Scope: util.ToPointer(\"Scope\"),\n TokenType: util.ToPointer(\"TokenType\"),\n}\n\n\nenterprise := integrations.Enterprise{\n Id: util.ToPointer(\"Id\"),\n Name: util.ToPointer(\"Name\"),\n}\n\n\nincomingWebhook := integrations.IncomingWebhook{\n Channel: util.ToPointer(\"Channel\"),\n ConfigurationUrl: util.ToPointer(\"ConfigurationUrl\"),\n Url: util.ToPointer(\"Url\"),\n}\n\n\nteam := integrations.Team{\n Id: util.ToPointer(\"Id\"),\n Name: util.ToPointer(\"Name\"),\n}\n\nrequest := integrations.SlackInstallation{\n AccessToken: util.ToPointer(\"AccessToken\"),\n AppId: util.ToPointer(\"AppId\"),\n AuthedUser: &authedUser,\n BotUserId: util.ToPointer(\"BotUserId\"),\n Enterprise: &enterprise,\n ExpiresIn: util.ToPointer(int64(123)),\n Id: util.ToPointer(\"Id\"),\n IncomingWebhook: &incomingWebhook,\n IsEnterpriseInstall: util.ToPointer(true),\n RefreshToken: util.ToPointer(\"RefreshToken\"),\n Scope: util.ToPointer(\"Scope\"),\n Team: &team,\n TokenType: util.ToPointer(\"TokenType\"),\n}\n\nresponse, err := client.Integrations.SaveSlackInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nauthedUser := integrations.AuthedUser{\n AccessToken: util.ToPointer(\"access_token\"),\n ExpiresIn: util.ToPointer(int64(7)),\n Id: util.ToPointer(\"id\"),\n RefreshToken: util.ToPointer(\"refresh_token\"),\n Scope: util.ToPointer(\"scope\"),\n TokenType: util.ToPointer(\"token_type\"),\n}\n\n\nenterprise := integrations.Enterprise{\n Id: util.ToPointer(\"id\"),\n Name: util.ToPointer(\"name\"),\n}\n\n\nincomingWebhook := integrations.IncomingWebhook{\n Channel: util.ToPointer(\"channel\"),\n ConfigurationUrl: util.ToPointer(\"configuration_url\"),\n Url: util.ToPointer(\"url\"),\n}\n\n\nteam := integrations.Team{\n Id: util.ToPointer(\"id\"),\n Name: util.ToPointer(\"name\"),\n}\n\nrequest := integrations.SlackInstallation{\n AccessToken: util.ToPointer(\"access_token\"),\n AppId: util.ToPointer(\"app_id\"),\n AuthedUser: &authedUser,\n BotUserId: util.ToPointer(\"bot_user_id\"),\n Enterprise: &enterprise,\n ExpiresIn: util.ToPointer(int64(1)),\n Id: util.ToPointer(\"H31-[g~J]11NRM\"),\n IncomingWebhook: &incomingWebhook,\n IsEnterpriseInstall: util.ToPointer(true),\n RefreshToken: util.ToPointer(\"refresh_token\"),\n Scope: util.ToPointer(\"scope\"),\n Team: &team,\n TokenType: util.ToPointer(\"token_type\"),\n}\n\nresponse, err := client.Integrations.SaveSlackInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/slack/installations/finish": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.SlackFinishInstallResponse{\n AppId: util.ToPointer(\"AppId\"),\n Code: util.ToPointer(\"Code\"),\n RedirectUrl: util.ToPointer(\"RedirectUrl\"),\n}\n\nresponse, err := client.Integrations.FinishSlackInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.SlackFinishInstallResponse{\n AppId: util.ToPointer(\"app_id\"),\n Code: util.ToPointer(\"code\"),\n RedirectUrl: util.ToPointer(\"redirect_url\"),\n}\n\nresponse, err := client.Integrations.FinishSlackInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/slack/installations/start": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nrequest := integrations.SlackStartInstall{\n AppId: util.ToPointer(\"AppId\"),\n AuthUrl: util.ToPointer(\"AuthUrl\"),\n ExtraScopes: []string{},\n RedirectUrl: util.ToPointer(\"RedirectUrl\"),\n}\n\nresponse, err := client.Integrations.StartSlackInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/integrations\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nrequest := integrations.SlackStartInstall{\n AppId: util.ToPointer(\"app_id\"),\n AuthUrl: util.ToPointer(\"auth_url\"),\n ExtraScopes: []string{},\n RedirectUrl: util.ToPointer(\"redirect_url\"),\n}\n\nresponse, err := client.Integrations.StartSlackInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/web_push/installations": { - "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/shared\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nwebPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{\n Auth: util.ToPointer(\"Auth\"),\n P256dh: util.ToPointer(\"P256dh\"),\n}\n\nrequest := shared.WebPushTokenPayload{\n Endpoint: util.ToPointer(\"Endpoint\"),\n Keys: &webPushTokenPayloadKeys,\n}\n\nresponse, err := client.Integrations.SaveWebPushInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "put": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/shared\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nwebPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{\n Auth: util.ToPointer(\"auth\"),\n P256dh: util.ToPointer(\"p256dh\"),\n}\n\nrequest := shared.WebPushTokenPayload{\n Endpoint: util.ToPointer(\"endpoint\"),\n Keys: &webPushTokenPayloadKeys,\n}\n\nresponse, err := client.Integrations.SaveWebPushInstallation(context.Background(), request)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/integrations/web_push/installations/start": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.StartWebPushInstallation(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Integrations.StartWebPushInstallation(context.Background())\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/notifications\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := notifications.ListNotificationsRequestParams{\n\n}\n\nresponse, err := client.Notifications.ListNotifications(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/notifications\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := notifications.ListNotificationsRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n Status: util.ToPointer(\"status\"),\n Category: util.ToPointer(\"category\"),\n Topic: util.ToPointer(\"topic\"),\n}\n\nresponse, err := client.Notifications.ListNotifications(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/archive": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/notifications\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := notifications.ArchiveAllNotificationsRequestParams{\n\n}\n\nresponse, err := client.Notifications.ArchiveAllNotifications(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/notifications\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := notifications.ArchiveAllNotificationsRequestParams{\n Category: util.ToPointer(\"category\"),\n Topic: util.ToPointer(\"topic\"),\n}\n\nresponse, err := client.Notifications.ArchiveAllNotifications(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/read": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n \"github.com/magicbell/magicbell-go/pkg/user-client/notifications\"\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\n\nparams := notifications.MarkAllNotificationsReadRequestParams{\n\n}\n\nresponse, err := client.Notifications.MarkAllNotificationsRead(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/notifications\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := notifications.MarkAllNotificationsReadRequestParams{\n Category: util.ToPointer(\"category\"),\n Topic: util.ToPointer(\"topic\"),\n}\n\nresponse, err := client.Notifications.MarkAllNotificationsRead(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/{notification_id}": { - "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.FetchNotification(context.Background(), \"notificationId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "get": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.FetchNotification(context.Background(), \"notification_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/{notification_id}/archive": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.ArchiveNotification(context.Background(), \"notificationId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.ArchiveNotification(context.Background(), \"notification_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/{notification_id}/read": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.MarkNotificationRead(context.Background(), \"notificationId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.MarkNotificationRead(context.Background(), \"notification_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/{notification_id}/unarchive": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.UnarchiveNotification(context.Background(), \"notificationId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.UnarchiveNotification(context.Background(), \"notification_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" }, "/notifications/{notification_id}/unread": { - "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.MarkNotificationUnread(context.Background(), \"notificationId\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" + "post": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\nresponse, err := client.Notifications.MarkNotificationUnread(context.Background(), \"notification_id\")\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n" } }, + "example": "import (\n \"fmt\"\n \"encoding/json\"\n \"context\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/util\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/channels\"\n)\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"ACCESS_TOKEN\")\nclient := client.NewClient(config)\n\n\nparams := channels.ListInboxTokensRequestParams{\n Limit: util.ToPointer(int64(8)),\n StartingAfter: util.ToPointer(\"starting_after\"),\n EndingBefore: util.ToPointer(\"ending_before\"),\n}\n\nresponse, err := client.Channels.ListInboxTokens(context.Background(), params)\nif err != nil {\n panic(err)\n}\n\nfmt.Println(response)\n", "authentication": { "bearer": { "constructor": "import (\n \"github.com/magicbell/magicbell-go/pkg/user-client/client\"\n \"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig\"\n )\n\nconfig := clientconfig.NewConfig()\nconfig.SetAccessToken(\"YOUR-TOKEN\")\n\nsdk := client.NewClient(config)", diff --git a/pkg/project-client/client/client.go b/pkg/project-client/client/client.go index db0b711..9ba7194 100644 --- a/pkg/project-client/client/client.go +++ b/pkg/project-client/client/client.go @@ -8,6 +8,7 @@ import ( "github.com/magicbell/magicbell-go/pkg/project-client/events" "github.com/magicbell/magicbell-go/pkg/project-client/integrations" "github.com/magicbell/magicbell-go/pkg/project-client/users" + "github.com/magicbell/magicbell-go/pkg/project-client/workflows" "time" ) @@ -17,6 +18,7 @@ type Client struct { Events *events.EventsService Integrations *integrations.IntegrationsService Users *users.UsersService + Workflows *workflows.WorkflowsService manager *configmanager.ConfigManager } @@ -26,6 +28,7 @@ func NewClient(config clientconfig.Config) *Client { events := events.NewEventsService() integrations := integrations.NewIntegrationsService() users := users.NewUsersService() + workflows := workflows.NewWorkflowsService() manager := configmanager.NewConfigManager(config) broadcasts.WithConfigManager(manager) @@ -33,6 +36,7 @@ func NewClient(config clientconfig.Config) *Client { events.WithConfigManager(manager) integrations.WithConfigManager(manager) users.WithConfigManager(manager) + workflows.WithConfigManager(manager) return &Client{ Broadcasts: broadcasts, @@ -40,6 +44,7 @@ func NewClient(config clientconfig.Config) *Client { Events: events, Integrations: integrations, Users: users, + Workflows: workflows, manager: manager, } } diff --git a/pkg/project-client/integrations/event_source_config.go b/pkg/project-client/integrations/event_source_config.go new file mode 100644 index 0000000..990f1e5 --- /dev/null +++ b/pkg/project-client/integrations/event_source_config.go @@ -0,0 +1,50 @@ +package integrations + +import "encoding/json" + +type EventSourceConfig struct { + Config *EventSourceConfigPayload `json:"config,omitempty" required:"true"` + Id *string `json:"id,omitempty" required:"true"` + Name *string `json:"name,omitempty" required:"true"` +} + +func (e *EventSourceConfig) GetConfig() *EventSourceConfigPayload { + if e == nil { + return nil + } + return e.Config +} + +func (e *EventSourceConfig) SetConfig(config EventSourceConfigPayload) { + e.Config = &config +} + +func (e *EventSourceConfig) GetId() *string { + if e == nil { + return nil + } + return e.Id +} + +func (e *EventSourceConfig) SetId(id string) { + e.Id = &id +} + +func (e *EventSourceConfig) GetName() *string { + if e == nil { + return nil + } + return e.Name +} + +func (e *EventSourceConfig) SetName(name string) { + e.Name = &name +} + +func (e EventSourceConfig) String() string { + jsonData, err := json.MarshalIndent(e, "", " ") + if err != nil { + return "error converting struct: EventSourceConfig to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/integrations/event_source_config_collection.go b/pkg/project-client/integrations/event_source_config_collection.go new file mode 100644 index 0000000..83f57c6 --- /dev/null +++ b/pkg/project-client/integrations/event_source_config_collection.go @@ -0,0 +1,41 @@ +package integrations + +import ( + "encoding/json" + "github.com/magicbell/magicbell-go/pkg/project-client/shared" +) + +type EventSourceConfigCollection struct { + Data []EventSourceConfig `json:"data,omitempty"` + Links *shared.Links `json:"links,omitempty"` +} + +func (e *EventSourceConfigCollection) GetData() []EventSourceConfig { + if e == nil { + return nil + } + return e.Data +} + +func (e *EventSourceConfigCollection) SetData(data []EventSourceConfig) { + e.Data = data +} + +func (e *EventSourceConfigCollection) GetLinks() *shared.Links { + if e == nil { + return nil + } + return e.Links +} + +func (e *EventSourceConfigCollection) SetLinks(links shared.Links) { + e.Links = &links +} + +func (e EventSourceConfigCollection) String() string { + jsonData, err := json.MarshalIndent(e, "", " ") + if err != nil { + return "error converting struct: EventSourceConfigCollection to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/integrations/event_source_config_payload.go b/pkg/project-client/integrations/event_source_config_payload.go new file mode 100644 index 0000000..69840af --- /dev/null +++ b/pkg/project-client/integrations/event_source_config_payload.go @@ -0,0 +1,26 @@ +package integrations + +import "encoding/json" + +type EventSourceConfigPayload struct { + Source *string `json:"source,omitempty" required:"true"` +} + +func (e *EventSourceConfigPayload) GetSource() *string { + if e == nil { + return nil + } + return e.Source +} + +func (e *EventSourceConfigPayload) SetSource(source string) { + e.Source = &source +} + +func (e EventSourceConfigPayload) String() string { + jsonData, err := json.MarshalIndent(e, "", " ") + if err != nil { + return "error converting struct: EventSourceConfigPayload to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/integrations/integrations_service.go b/pkg/project-client/integrations/integrations_service.go index 9284caf..07c3e84 100644 --- a/pkg/project-client/integrations/integrations_service.go +++ b/pkg/project-client/integrations/integrations_service.go @@ -132,6 +132,72 @@ func (api *IntegrationsService) DeleteApnsIntegration(ctx context.Context, param return shared.NewClientResponse[any](resp), nil } +// Retrieves the current EventSource integration configurations for a specific integration type in the project. Returns configuration details and status information. +func (api *IntegrationsService) ListEventsourceIntegrations(ctx context.Context) (*shared.ClientResponse[EventSourceConfigCollection], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("GET"). + WithPath("/integrations/eventsource"). + WithConfig(config). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[EventSourceConfigCollection](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[EventSourceConfigCollection](err) + } + + return shared.NewClientResponse[EventSourceConfigCollection](resp), nil +} + +// Updates or creates the EventSource integration for the project. +func (api *IntegrationsService) SaveEventsourceIntegration(ctx context.Context, eventSourceConfigPayload EventSourceConfigPayload) (*shared.ClientResponse[EventSourceConfigPayload], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("PUT"). + WithPath("/integrations/eventsource"). + WithConfig(config). + WithBody(eventSourceConfigPayload). + AddHeader("CONTENT-TYPE", "application/json"). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[EventSourceConfigPayload](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[EventSourceConfigPayload](err) + } + + return shared.NewClientResponse[EventSourceConfigPayload](resp), nil +} + +// Deletes the EventSource integration configuration from the project. This will disable the integration's functionality within the project. +func (api *IntegrationsService) DeleteEventsourceIntegration(ctx context.Context, params DeleteEventsourceIntegrationRequestParams) (*shared.ClientResponse[any], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("DELETE"). + WithPath("/integrations/eventsource"). + WithConfig(config). + WithOptions(params). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[any](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[any](err) + } + + return shared.NewClientResponse[any](resp), nil +} + // Retrieves the current Expo integration configurations for a specific integration type in the project. Returns configuration details and status information. func (api *IntegrationsService) ListExpoIntegrations(ctx context.Context) (*shared.ClientResponse[ExpoConfigCollection], *shared.ClientError) { config := *api.getConfig() @@ -726,6 +792,72 @@ func (api *IntegrationsService) DeleteSlackIntegration(ctx context.Context, para return shared.NewClientResponse[any](resp), nil } +// Retrieves the current SMTP integration configurations for a specific integration type in the project. Returns configuration details and status information. +func (api *IntegrationsService) ListSmtpIntegrations(ctx context.Context) (*shared.ClientResponse[SmtpConfigObjectCollection], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("GET"). + WithPath("/integrations/smtp"). + WithConfig(config). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[SmtpConfigObjectCollection](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[SmtpConfigObjectCollection](err) + } + + return shared.NewClientResponse[SmtpConfigObjectCollection](resp), nil +} + +// Updates or creates the SMTP integration for the project. +func (api *IntegrationsService) SaveSmtpIntegration(ctx context.Context, smtpConfig SmtpConfig) (*shared.ClientResponse[SmtpConfig], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("PUT"). + WithPath("/integrations/smtp"). + WithConfig(config). + WithBody(smtpConfig). + AddHeader("CONTENT-TYPE", "application/json"). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[SmtpConfig](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[SmtpConfig](err) + } + + return shared.NewClientResponse[SmtpConfig](resp), nil +} + +// Deletes the SMTP integration configuration from the project. This will disable the integration's functionality within the project. +func (api *IntegrationsService) DeleteSmtpIntegration(ctx context.Context, params DeleteSmtpIntegrationRequestParams) (*shared.ClientResponse[any], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("DELETE"). + WithPath("/integrations/smtp"). + WithConfig(config). + WithOptions(params). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[any](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[any](err) + } + + return shared.NewClientResponse[any](resp), nil +} + // Retrieves the current Stripe integration configurations for a specific integration type in the project. Returns configuration details and status information. func (api *IntegrationsService) ListStripeIntegrations(ctx context.Context) (*shared.ClientResponse[StripeConfigCollection], *shared.ClientError) { config := *api.getConfig() diff --git a/pkg/project-client/integrations/request_params.go b/pkg/project-client/integrations/request_params.go index 3ed1014..9b72635 100644 --- a/pkg/project-client/integrations/request_params.go +++ b/pkg/project-client/integrations/request_params.go @@ -24,6 +24,14 @@ func (params *DeleteApnsIntegrationRequestParams) SetId(id string) { params.Id = &id } +type DeleteEventsourceIntegrationRequestParams struct { + Id *string `explode:"true" serializationStyle:"form" queryParam:"id"` +} + +func (params *DeleteEventsourceIntegrationRequestParams) SetId(id string) { + params.Id = &id +} + type DeleteExpoIntegrationRequestParams struct { Id *string `explode:"true" serializationStyle:"form" queryParam:"id"` } @@ -96,6 +104,14 @@ func (params *DeleteSlackIntegrationRequestParams) SetId(id string) { params.Id = &id } +type DeleteSmtpIntegrationRequestParams struct { + Id *string `explode:"true" serializationStyle:"form" queryParam:"id"` +} + +func (params *DeleteSmtpIntegrationRequestParams) SetId(id string) { + params.Id = &id +} + type DeleteStripeIntegrationRequestParams struct { Id *string `explode:"true" serializationStyle:"form" queryParam:"id"` } diff --git a/pkg/project-client/integrations/sendgrid_config_payload.go b/pkg/project-client/integrations/sendgrid_config_payload.go index 7b5719c..2ab0fc5 100644 --- a/pkg/project-client/integrations/sendgrid_config_payload.go +++ b/pkg/project-client/integrations/sendgrid_config_payload.go @@ -8,9 +8,9 @@ import ( type SendgridConfigPayload struct { // The API key for Sendgrid - ApiKey *string `json:"api_key,omitempty" required:"true"` - From *SendgridConfigPayloadFrom `json:"from,omitempty"` - ReplyTo *ReplyTo `json:"reply_to,omitempty"` + ApiKey *string `json:"api_key,omitempty" required:"true"` + From *SendgridConfigPayloadFrom `json:"from,omitempty"` + ReplyTo *SendgridConfigPayloadReplyTo `json:"reply_to,omitempty"` } func (s *SendgridConfigPayload) GetApiKey() *string { @@ -35,14 +35,14 @@ func (s *SendgridConfigPayload) SetFrom(from SendgridConfigPayloadFrom) { s.From = &from } -func (s *SendgridConfigPayload) GetReplyTo() *ReplyTo { +func (s *SendgridConfigPayload) GetReplyTo() *SendgridConfigPayloadReplyTo { if s == nil { return nil } return s.ReplyTo } -func (s *SendgridConfigPayload) SetReplyTo(replyTo ReplyTo) { +func (s *SendgridConfigPayload) SetReplyTo(replyTo SendgridConfigPayloadReplyTo) { s.ReplyTo = &replyTo } @@ -99,47 +99,47 @@ func (s *SendgridConfigPayloadFrom) UnmarshalJSON(data []byte) error { return unmarshal.UnmarshalNullable(data, s) } -type ReplyTo struct { +type SendgridConfigPayloadReplyTo struct { // The email address to reply to Email *string `json:"email,omitempty" required:"true"` // The name to reply to Name *util.Nullable[string] `json:"name,omitempty"` } -func (r *ReplyTo) GetEmail() *string { - if r == nil { +func (s *SendgridConfigPayloadReplyTo) GetEmail() *string { + if s == nil { return nil } - return r.Email + return s.Email } -func (r *ReplyTo) SetEmail(email string) { - r.Email = &email +func (s *SendgridConfigPayloadReplyTo) SetEmail(email string) { + s.Email = &email } -func (r *ReplyTo) GetName() *util.Nullable[string] { - if r == nil { +func (s *SendgridConfigPayloadReplyTo) GetName() *util.Nullable[string] { + if s == nil { return nil } - return r.Name + return s.Name } -func (r *ReplyTo) SetName(name util.Nullable[string]) { - r.Name = &name +func (s *SendgridConfigPayloadReplyTo) SetName(name util.Nullable[string]) { + s.Name = &name } -func (r *ReplyTo) SetNameNull() { - r.Name = &util.Nullable[string]{IsNull: true} +func (s *SendgridConfigPayloadReplyTo) SetNameNull() { + s.Name = &util.Nullable[string]{IsNull: true} } -func (r ReplyTo) String() string { - jsonData, err := json.MarshalIndent(r, "", " ") +func (s SendgridConfigPayloadReplyTo) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") if err != nil { - return "error converting struct: ReplyTo to string" + return "error converting struct: SendgridConfigPayloadReplyTo to string" } return string(jsonData) } -func (r *ReplyTo) UnmarshalJSON(data []byte) error { - return unmarshal.UnmarshalNullable(data, r) +func (s *SendgridConfigPayloadReplyTo) UnmarshalJSON(data []byte) error { + return unmarshal.UnmarshalNullable(data, s) } diff --git a/pkg/project-client/integrations/smtp_config.go b/pkg/project-client/integrations/smtp_config.go new file mode 100644 index 0000000..098eb57 --- /dev/null +++ b/pkg/project-client/integrations/smtp_config.go @@ -0,0 +1,190 @@ +package integrations + +import "encoding/json" + +type SmtpConfig struct { + // Default sender email address + From *SmtpConfigFrom `json:"from,omitempty" required:"true"` + // SMTP server hostname + Host *string `json:"host,omitempty" required:"true"` + // SMTP authentication password + Password *string `json:"password,omitempty" required:"true"` + // SMTP server port + Port *int64 `json:"port,omitempty" required:"true" min:"1" max:"65535"` + // Reply-to email address + ReplyTo *SmtpConfigReplyTo `json:"reply_to,omitempty"` + // SMTP security/encryption method + Security *Security `json:"security,omitempty"` + // SMTP authentication username + Username *string `json:"username,omitempty" required:"true"` +} + +func (s *SmtpConfig) GetFrom() *SmtpConfigFrom { + if s == nil { + return nil + } + return s.From +} + +func (s *SmtpConfig) SetFrom(from SmtpConfigFrom) { + s.From = &from +} + +func (s *SmtpConfig) GetHost() *string { + if s == nil { + return nil + } + return s.Host +} + +func (s *SmtpConfig) SetHost(host string) { + s.Host = &host +} + +func (s *SmtpConfig) GetPassword() *string { + if s == nil { + return nil + } + return s.Password +} + +func (s *SmtpConfig) SetPassword(password string) { + s.Password = &password +} + +func (s *SmtpConfig) GetPort() *int64 { + if s == nil { + return nil + } + return s.Port +} + +func (s *SmtpConfig) SetPort(port int64) { + s.Port = &port +} + +func (s *SmtpConfig) GetReplyTo() *SmtpConfigReplyTo { + if s == nil { + return nil + } + return s.ReplyTo +} + +func (s *SmtpConfig) SetReplyTo(replyTo SmtpConfigReplyTo) { + s.ReplyTo = &replyTo +} + +func (s *SmtpConfig) GetSecurity() *Security { + if s == nil { + return nil + } + return s.Security +} + +func (s *SmtpConfig) SetSecurity(security Security) { + s.Security = &security +} + +func (s *SmtpConfig) GetUsername() *string { + if s == nil { + return nil + } + return s.Username +} + +func (s *SmtpConfig) SetUsername(username string) { + s.Username = &username +} + +func (s SmtpConfig) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") + if err != nil { + return "error converting struct: SmtpConfig to string" + } + return string(jsonData) +} + +// Default sender email address +type SmtpConfigFrom struct { + // Sender email address + Email *string `json:"email,omitempty" required:"true"` + // Sender name + Name *string `json:"name,omitempty"` +} + +func (s *SmtpConfigFrom) GetEmail() *string { + if s == nil { + return nil + } + return s.Email +} + +func (s *SmtpConfigFrom) SetEmail(email string) { + s.Email = &email +} + +func (s *SmtpConfigFrom) GetName() *string { + if s == nil { + return nil + } + return s.Name +} + +func (s *SmtpConfigFrom) SetName(name string) { + s.Name = &name +} + +func (s SmtpConfigFrom) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") + if err != nil { + return "error converting struct: SmtpConfigFrom to string" + } + return string(jsonData) +} + +// Reply-to email address +type SmtpConfigReplyTo struct { + // Reply-to email address + Email *string `json:"email,omitempty" required:"true"` + // Reply-to name + Name *string `json:"name,omitempty"` +} + +func (s *SmtpConfigReplyTo) GetEmail() *string { + if s == nil { + return nil + } + return s.Email +} + +func (s *SmtpConfigReplyTo) SetEmail(email string) { + s.Email = &email +} + +func (s *SmtpConfigReplyTo) GetName() *string { + if s == nil { + return nil + } + return s.Name +} + +func (s *SmtpConfigReplyTo) SetName(name string) { + s.Name = &name +} + +func (s SmtpConfigReplyTo) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") + if err != nil { + return "error converting struct: SmtpConfigReplyTo to string" + } + return string(jsonData) +} + +// SMTP security/encryption method +type Security string + +const ( + SECURITY_NONE Security = "none" + SECURITY_SSL Security = "ssl" + SECURITY_STARTTLS Security = "starttls" +) diff --git a/pkg/project-client/integrations/smtp_config_object.go b/pkg/project-client/integrations/smtp_config_object.go new file mode 100644 index 0000000..f047da4 --- /dev/null +++ b/pkg/project-client/integrations/smtp_config_object.go @@ -0,0 +1,50 @@ +package integrations + +import "encoding/json" + +type SmtpConfigObject struct { + Config *SmtpConfig `json:"config,omitempty" required:"true"` + Id *string `json:"id,omitempty" required:"true"` + Name *string `json:"name,omitempty" required:"true"` +} + +func (s *SmtpConfigObject) GetConfig() *SmtpConfig { + if s == nil { + return nil + } + return s.Config +} + +func (s *SmtpConfigObject) SetConfig(config SmtpConfig) { + s.Config = &config +} + +func (s *SmtpConfigObject) GetId() *string { + if s == nil { + return nil + } + return s.Id +} + +func (s *SmtpConfigObject) SetId(id string) { + s.Id = &id +} + +func (s *SmtpConfigObject) GetName() *string { + if s == nil { + return nil + } + return s.Name +} + +func (s *SmtpConfigObject) SetName(name string) { + s.Name = &name +} + +func (s SmtpConfigObject) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") + if err != nil { + return "error converting struct: SmtpConfigObject to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/integrations/smtp_config_object_collection.go b/pkg/project-client/integrations/smtp_config_object_collection.go new file mode 100644 index 0000000..e75f2e3 --- /dev/null +++ b/pkg/project-client/integrations/smtp_config_object_collection.go @@ -0,0 +1,41 @@ +package integrations + +import ( + "encoding/json" + "github.com/magicbell/magicbell-go/pkg/project-client/shared" +) + +type SmtpConfigObjectCollection struct { + Data []SmtpConfigObject `json:"data,omitempty"` + Links *shared.Links `json:"links,omitempty"` +} + +func (s *SmtpConfigObjectCollection) GetData() []SmtpConfigObject { + if s == nil { + return nil + } + return s.Data +} + +func (s *SmtpConfigObjectCollection) SetData(data []SmtpConfigObject) { + s.Data = data +} + +func (s *SmtpConfigObjectCollection) GetLinks() *shared.Links { + if s == nil { + return nil + } + return s.Links +} + +func (s *SmtpConfigObjectCollection) SetLinks(links shared.Links) { + s.Links = &links +} + +func (s SmtpConfigObjectCollection) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") + if err != nil { + return "error converting struct: SmtpConfigObjectCollection to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/integrations/stripe_config_payload.go b/pkg/project-client/integrations/stripe_config_payload.go index 680eda8..34a2bf2 100644 --- a/pkg/project-client/integrations/stripe_config_payload.go +++ b/pkg/project-client/integrations/stripe_config_payload.go @@ -3,10 +3,23 @@ package integrations import "encoding/json" type StripeConfigPayload struct { + // The unique identifier for this configuration + Id *string `json:"id,omitempty"` // The signing secret to verify incoming requests from Stripe WebhookSigningSecret *string `json:"webhook_signing_secret,omitempty" required:"true" maxLength:"100" minLength:"1"` } +func (s *StripeConfigPayload) GetId() *string { + if s == nil { + return nil + } + return s.Id +} + +func (s *StripeConfigPayload) SetId(id string) { + s.Id = &id +} + func (s *StripeConfigPayload) GetWebhookSigningSecret() *string { if s == nil { return nil diff --git a/pkg/project-client/integrations/webpush_config_payload.go b/pkg/project-client/integrations/webpush_config_payload.go index 072bc3d..2b845fc 100644 --- a/pkg/project-client/integrations/webpush_config_payload.go +++ b/pkg/project-client/integrations/webpush_config_payload.go @@ -5,7 +5,7 @@ import "encoding/json" type WebpushConfigPayload struct { // VAPID private key - from the pair you generated. PrivateKey *string `json:"private_key,omitempty" required:"true" maxLength:"128" minLength:"8"` - // VAPID public key - generate one at https://tools.reactpwa.com/vapid. + // VAPID public key - generate one at https://magicbell.com/web-push/vapid-keys. PublicKey *string `json:"public_key,omitempty" required:"true" maxLength:"128" minLength:"8"` } diff --git a/pkg/project-client/internal/clients/rest/httptransport/error_response.go b/pkg/project-client/internal/clients/rest/httptransport/error_response.go index 0da26fe..cebf422 100644 --- a/pkg/project-client/internal/clients/rest/httptransport/error_response.go +++ b/pkg/project-client/internal/clients/rest/httptransport/error_response.go @@ -1,6 +1,9 @@ package httptransport -import "fmt" +import ( + "fmt" + "net/http" +) type ErrorResponse[T any] struct { Err error @@ -9,6 +12,7 @@ type ErrorResponse[T any] struct { Headers map[string]string Body []byte Data T + Raw *http.Response } func NewErrorResponse[T any](err error, resp *Response[T]) *ErrorResponse[T] { @@ -26,6 +30,7 @@ func NewErrorResponse[T any](err error, resp *Response[T]) *ErrorResponse[T] { Headers: resp.Headers, Body: resp.Body, Data: resp.Data, + Raw: resp.Raw, } } diff --git a/pkg/project-client/internal/clients/rest/httptransport/response.go b/pkg/project-client/internal/clients/rest/httptransport/response.go index 6cb54df..e68f213 100644 --- a/pkg/project-client/internal/clients/rest/httptransport/response.go +++ b/pkg/project-client/internal/clients/rest/httptransport/response.go @@ -10,6 +10,7 @@ type Response[T any] struct { Headers map[string]string Body []byte Data T + Raw *http.Response } func (r *Response[T]) Clone() Response[T] { @@ -46,6 +47,7 @@ func NewResponse[T any](resp *http.Response) (*Response[T], error) { Headers: responseHeaders, Body: body, Data: *placeholderData, + Raw: resp, }, nil } diff --git a/pkg/project-client/internal/configmanager/config_manager.go b/pkg/project-client/internal/configmanager/config_manager.go index 9ca7551..0793382 100644 --- a/pkg/project-client/internal/configmanager/config_manager.go +++ b/pkg/project-client/internal/configmanager/config_manager.go @@ -11,6 +11,7 @@ type ConfigManager struct { Events clientconfig.Config Integrations clientconfig.Config Users clientconfig.Config + Workflows clientconfig.Config } func NewConfigManager(config clientconfig.Config) *ConfigManager { @@ -20,6 +21,7 @@ func NewConfigManager(config clientconfig.Config) *ConfigManager { Events: config, Integrations: config, Users: config, + Workflows: config, } } @@ -29,6 +31,7 @@ func (c *ConfigManager) SetBaseUrl(baseUrl string) { c.Events.SetBaseUrl(baseUrl) c.Integrations.SetBaseUrl(baseUrl) c.Users.SetBaseUrl(baseUrl) + c.Workflows.SetBaseUrl(baseUrl) } func (c *ConfigManager) SetTimeout(timeout time.Duration) { @@ -37,6 +40,7 @@ func (c *ConfigManager) SetTimeout(timeout time.Duration) { c.Events.SetTimeout(timeout) c.Integrations.SetTimeout(timeout) c.Users.SetTimeout(timeout) + c.Workflows.SetTimeout(timeout) } func (c *ConfigManager) SetAccessToken(accessToken string) { @@ -45,6 +49,7 @@ func (c *ConfigManager) SetAccessToken(accessToken string) { c.Events.SetAccessToken(accessToken) c.Integrations.SetAccessToken(accessToken) c.Users.SetAccessToken(accessToken) + c.Workflows.SetAccessToken(accessToken) } func (c *ConfigManager) UpdateAccessToken(originalValue string, newValue string) { @@ -68,6 +73,10 @@ func (c *ConfigManager) UpdateAccessToken(originalValue string, newValue string) if c.Users.AccessToken != nil && *c.Users.AccessToken == originalValue { c.Users.SetAccessToken(newValue) } + + if c.Workflows.AccessToken != nil && *c.Workflows.AccessToken == originalValue { + c.Workflows.SetAccessToken(newValue) + } } func (c *ConfigManager) GetBroadcasts() *clientconfig.Config { @@ -85,3 +94,6 @@ func (c *ConfigManager) GetIntegrations() *clientconfig.Config { func (c *ConfigManager) GetUsers() *clientconfig.Config { return &c.Users } +func (c *ConfigManager) GetWorkflows() *clientconfig.Config { + return &c.Workflows +} diff --git a/pkg/project-client/internal/contenttypes/from_binary.go b/pkg/project-client/internal/contenttypes/from_binary.go index d1272fe..502e770 100644 --- a/pkg/project-client/internal/contenttypes/from_binary.go +++ b/pkg/project-client/internal/contenttypes/from_binary.go @@ -2,12 +2,23 @@ package contenttypes import ( "fmt" + "reflect" ) func FromBinary(data any, target any) error { + targetValue := reflect.ValueOf(target) + + if targetValue.Kind() != reflect.Ptr || targetValue.IsNil() { + return fmt.Errorf("target must be a non-nil pointer") + } + + targetValue = targetValue.Elem() + if b, ok := data.([]byte); ok { - target = &b - return nil + if targetValue.Kind() == reflect.Slice && targetValue.Type().Elem().Kind() == reflect.Uint8 { + targetValue.Set(reflect.ValueOf(b)) + return nil + } } return fmt.Errorf("Failed to convert response body to byte array") diff --git a/pkg/project-client/shared/client_error.go b/pkg/project-client/shared/client_error.go index e0607b7..a6e9272 100644 --- a/pkg/project-client/shared/client_error.go +++ b/pkg/project-client/shared/client_error.go @@ -2,11 +2,13 @@ package shared import ( "github.com/magicbell/magicbell-go/pkg/project-client/internal/clients/rest/httptransport" + "net/http" ) type ClientError struct { Err error Body []byte + Raw *http.Response Metadata ClientErrorMetadata } @@ -19,6 +21,7 @@ func NewClientError[T any](transportError *httptransport.ErrorResponse[T]) *Clie return &ClientError{ Err: transportError.GetError(), Body: transportError.GetBody(), + Raw: transportError.Raw, Metadata: ClientErrorMetadata{ StatusCode: transportError.GetStatusCode(), Headers: transportError.GetHeaders(), diff --git a/pkg/project-client/shared/client_response.go b/pkg/project-client/shared/client_response.go index 3019553..28c03d2 100644 --- a/pkg/project-client/shared/client_response.go +++ b/pkg/project-client/shared/client_response.go @@ -2,12 +2,13 @@ package shared import ( "encoding/json" - "github.com/magicbell/magicbell-go/pkg/project-client/internal/clients/rest/httptransport" + "net/http" ) type ClientResponse[T any] struct { Data T + Raw *http.Response Metadata ClientResponseMetadata } @@ -19,6 +20,7 @@ type ClientResponseMetadata struct { func NewClientResponse[T any](resp *httptransport.Response[T]) *ClientResponse[T] { return &ClientResponse[T]{ Data: resp.Data, + Raw: resp.Raw, Metadata: ClientResponseMetadata{ StatusCode: resp.StatusCode, Headers: resp.Headers, diff --git a/pkg/project-client/workflows/create_run_response.go b/pkg/project-client/workflows/create_run_response.go new file mode 100644 index 0000000..e114812 --- /dev/null +++ b/pkg/project-client/workflows/create_run_response.go @@ -0,0 +1,26 @@ +package workflows + +import "encoding/json" + +type CreateRunResponse struct { + Id *string `json:"id,omitempty" required:"true"` +} + +func (c *CreateRunResponse) GetId() *string { + if c == nil { + return nil + } + return c.Id +} + +func (c *CreateRunResponse) SetId(id string) { + c.Id = &id +} + +func (c CreateRunResponse) String() string { + jsonData, err := json.MarshalIndent(c, "", " ") + if err != nil { + return "error converting struct: CreateRunResponse to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/workflows/execute_workflow_request.go b/pkg/project-client/workflows/execute_workflow_request.go new file mode 100644 index 0000000..1b4161c --- /dev/null +++ b/pkg/project-client/workflows/execute_workflow_request.go @@ -0,0 +1,50 @@ +package workflows + +import ( + "encoding/json" + "github.com/magicbell/magicbell-go/pkg/project-client/internal/unmarshal" + "github.com/magicbell/magicbell-go/pkg/project-client/util" +) + +type ExecuteWorkflowRequest struct { + Input *util.Nullable[any] `json:"input,omitempty"` + Key *string `json:"key,omitempty" required:"true" pattern:"^[A-Za-z0-9\_\.\-\:]+$"` +} + +func (e *ExecuteWorkflowRequest) GetInput() *util.Nullable[any] { + if e == nil { + return nil + } + return e.Input +} + +func (e *ExecuteWorkflowRequest) SetInput(input util.Nullable[any]) { + e.Input = &input +} + +func (e *ExecuteWorkflowRequest) SetInputNull() { + e.Input = &util.Nullable[any]{IsNull: true} +} + +func (e *ExecuteWorkflowRequest) GetKey() *string { + if e == nil { + return nil + } + return e.Key +} + +func (e *ExecuteWorkflowRequest) SetKey(key string) { + e.Key = &key +} + +func (e ExecuteWorkflowRequest) String() string { + jsonData, err := json.MarshalIndent(e, "", " ") + if err != nil { + return "error converting struct: ExecuteWorkflowRequest to string" + } + return string(jsonData) +} + +func (e *ExecuteWorkflowRequest) UnmarshalJSON(data []byte) error { + return unmarshal.UnmarshalNullable(data, e) +} diff --git a/pkg/project-client/workflows/get_run_response.go b/pkg/project-client/workflows/get_run_response.go new file mode 100644 index 0000000..9bec349 --- /dev/null +++ b/pkg/project-client/workflows/get_run_response.go @@ -0,0 +1,133 @@ +package workflows + +import "encoding/json" + +type GetRunResponse struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Status *GetRunResponseStatus `json:"status,omitempty"` + WorkflowKey *string `json:"workflow_key,omitempty"` +} + +func (g *GetRunResponse) GetCreatedAt() *string { + if g == nil { + return nil + } + return g.CreatedAt +} + +func (g *GetRunResponse) SetCreatedAt(createdAt string) { + g.CreatedAt = &createdAt +} + +func (g *GetRunResponse) GetId() *string { + if g == nil { + return nil + } + return g.Id +} + +func (g *GetRunResponse) SetId(id string) { + g.Id = &id +} + +func (g *GetRunResponse) GetStatus() *GetRunResponseStatus { + if g == nil { + return nil + } + return g.Status +} + +func (g *GetRunResponse) SetStatus(status GetRunResponseStatus) { + g.Status = &status +} + +func (g *GetRunResponse) GetWorkflowKey() *string { + if g == nil { + return nil + } + return g.WorkflowKey +} + +func (g *GetRunResponse) SetWorkflowKey(workflowKey string) { + g.WorkflowKey = &workflowKey +} + +func (g GetRunResponse) String() string { + jsonData, err := json.MarshalIndent(g, "", " ") + if err != nil { + return "error converting struct: GetRunResponse to string" + } + return string(jsonData) +} + +type GetRunResponseStatus struct { + CompletedAt *string `json:"completed_at,omitempty"` + Error *string `json:"error,omitempty"` + NextStep *int64 `json:"next_step,omitempty"` + StartedAt *string `json:"started_at,omitempty"` + State *int64 `json:"state,omitempty"` +} + +func (g *GetRunResponseStatus) GetCompletedAt() *string { + if g == nil { + return nil + } + return g.CompletedAt +} + +func (g *GetRunResponseStatus) SetCompletedAt(completedAt string) { + g.CompletedAt = &completedAt +} + +func (g *GetRunResponseStatus) GetError() *string { + if g == nil { + return nil + } + return g.Error +} + +func (g *GetRunResponseStatus) SetError(error string) { + g.Error = &error +} + +func (g *GetRunResponseStatus) GetNextStep() *int64 { + if g == nil { + return nil + } + return g.NextStep +} + +func (g *GetRunResponseStatus) SetNextStep(nextStep int64) { + g.NextStep = &nextStep +} + +func (g *GetRunResponseStatus) GetStartedAt() *string { + if g == nil { + return nil + } + return g.StartedAt +} + +func (g *GetRunResponseStatus) SetStartedAt(startedAt string) { + g.StartedAt = &startedAt +} + +func (g *GetRunResponseStatus) GetState() *int64 { + if g == nil { + return nil + } + return g.State +} + +func (g *GetRunResponseStatus) SetState(state int64) { + g.State = &state +} + +func (g GetRunResponseStatus) String() string { + jsonData, err := json.MarshalIndent(g, "", " ") + if err != nil { + return "error converting struct: GetRunResponseStatus to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/workflows/workflow_definition.go b/pkg/project-client/workflows/workflow_definition.go new file mode 100644 index 0000000..3c2773f --- /dev/null +++ b/pkg/project-client/workflows/workflow_definition.go @@ -0,0 +1,113 @@ +package workflows + +import ( + "encoding/json" + "github.com/magicbell/magicbell-go/pkg/project-client/internal/unmarshal" + "github.com/magicbell/magicbell-go/pkg/project-client/util" +) + +type WorkflowDefinition struct { + Disabled *bool `json:"disabled,omitempty"` + Key *string `json:"key,omitempty" required:"true" minLength:"3" pattern:"^[A-Za-z0-9\_\.\-\:]+$"` + Steps []Steps `json:"steps,omitempty" required:"true"` +} + +func (w *WorkflowDefinition) GetDisabled() *bool { + if w == nil { + return nil + } + return w.Disabled +} + +func (w *WorkflowDefinition) SetDisabled(disabled bool) { + w.Disabled = &disabled +} + +func (w *WorkflowDefinition) GetKey() *string { + if w == nil { + return nil + } + return w.Key +} + +func (w *WorkflowDefinition) SetKey(key string) { + w.Key = &key +} + +func (w *WorkflowDefinition) GetSteps() []Steps { + if w == nil { + return nil + } + return w.Steps +} + +func (w *WorkflowDefinition) SetSteps(steps []Steps) { + w.Steps = steps +} + +func (w WorkflowDefinition) String() string { + jsonData, err := json.MarshalIndent(w, "", " ") + if err != nil { + return "error converting struct: WorkflowDefinition to string" + } + return string(jsonData) +} + +type Steps struct { + Command *string `json:"command,omitempty" required:"true" pattern:"^[A-Za-z0-9\_\:]+$"` + If_ *util.Nullable[string] `json:"if,omitempty"` + Input *util.Nullable[any] `json:"input,omitempty"` +} + +func (s *Steps) GetCommand() *string { + if s == nil { + return nil + } + return s.Command +} + +func (s *Steps) SetCommand(command string) { + s.Command = &command +} + +func (s *Steps) GetIf_() *util.Nullable[string] { + if s == nil { + return nil + } + return s.If_ +} + +func (s *Steps) SetIf_(if_ util.Nullable[string]) { + s.If_ = &if_ +} + +func (s *Steps) SetIf_Null() { + s.If_ = &util.Nullable[string]{IsNull: true} +} + +func (s *Steps) GetInput() *util.Nullable[any] { + if s == nil { + return nil + } + return s.Input +} + +func (s *Steps) SetInput(input util.Nullable[any]) { + s.Input = &input +} + +func (s *Steps) SetInputNull() { + s.Input = &util.Nullable[any]{IsNull: true} +} + +func (s Steps) String() string { + jsonData, err := json.MarshalIndent(s, "", " ") + if err != nil { + return "error converting struct: Steps to string" + } + return string(jsonData) +} + +func (s *Steps) UnmarshalJSON(data []byte) error { + return unmarshal.UnmarshalNullable(data, s) +} diff --git a/pkg/project-client/workflows/workflow_run.go b/pkg/project-client/workflows/workflow_run.go new file mode 100644 index 0000000..92f377f --- /dev/null +++ b/pkg/project-client/workflows/workflow_run.go @@ -0,0 +1,133 @@ +package workflows + +import "encoding/json" + +type WorkflowRun struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Status *WorkflowRunStatus `json:"status,omitempty"` + WorkflowKey *string `json:"workflow_key,omitempty"` +} + +func (w *WorkflowRun) GetCreatedAt() *string { + if w == nil { + return nil + } + return w.CreatedAt +} + +func (w *WorkflowRun) SetCreatedAt(createdAt string) { + w.CreatedAt = &createdAt +} + +func (w *WorkflowRun) GetId() *string { + if w == nil { + return nil + } + return w.Id +} + +func (w *WorkflowRun) SetId(id string) { + w.Id = &id +} + +func (w *WorkflowRun) GetStatus() *WorkflowRunStatus { + if w == nil { + return nil + } + return w.Status +} + +func (w *WorkflowRun) SetStatus(status WorkflowRunStatus) { + w.Status = &status +} + +func (w *WorkflowRun) GetWorkflowKey() *string { + if w == nil { + return nil + } + return w.WorkflowKey +} + +func (w *WorkflowRun) SetWorkflowKey(workflowKey string) { + w.WorkflowKey = &workflowKey +} + +func (w WorkflowRun) String() string { + jsonData, err := json.MarshalIndent(w, "", " ") + if err != nil { + return "error converting struct: WorkflowRun to string" + } + return string(jsonData) +} + +type WorkflowRunStatus struct { + CompletedAt *string `json:"completed_at,omitempty"` + Error *string `json:"error,omitempty"` + NextStep *int64 `json:"next_step,omitempty"` + StartedAt *string `json:"started_at,omitempty"` + State *int64 `json:"state,omitempty"` +} + +func (w *WorkflowRunStatus) GetCompletedAt() *string { + if w == nil { + return nil + } + return w.CompletedAt +} + +func (w *WorkflowRunStatus) SetCompletedAt(completedAt string) { + w.CompletedAt = &completedAt +} + +func (w *WorkflowRunStatus) GetError() *string { + if w == nil { + return nil + } + return w.Error +} + +func (w *WorkflowRunStatus) SetError(error string) { + w.Error = &error +} + +func (w *WorkflowRunStatus) GetNextStep() *int64 { + if w == nil { + return nil + } + return w.NextStep +} + +func (w *WorkflowRunStatus) SetNextStep(nextStep int64) { + w.NextStep = &nextStep +} + +func (w *WorkflowRunStatus) GetStartedAt() *string { + if w == nil { + return nil + } + return w.StartedAt +} + +func (w *WorkflowRunStatus) SetStartedAt(startedAt string) { + w.StartedAt = &startedAt +} + +func (w *WorkflowRunStatus) GetState() *int64 { + if w == nil { + return nil + } + return w.State +} + +func (w *WorkflowRunStatus) SetState(state int64) { + w.State = &state +} + +func (w WorkflowRunStatus) String() string { + jsonData, err := json.MarshalIndent(w, "", " ") + if err != nil { + return "error converting struct: WorkflowRunStatus to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/workflows/workflow_run_collection.go b/pkg/project-client/workflows/workflow_run_collection.go new file mode 100644 index 0000000..f6780de --- /dev/null +++ b/pkg/project-client/workflows/workflow_run_collection.go @@ -0,0 +1,41 @@ +package workflows + +import ( + "encoding/json" + "github.com/magicbell/magicbell-go/pkg/project-client/shared" +) + +type WorkflowRunCollection struct { + Data []WorkflowRun `json:"data,omitempty"` + Links *shared.Links `json:"links,omitempty"` +} + +func (w *WorkflowRunCollection) GetData() []WorkflowRun { + if w == nil { + return nil + } + return w.Data +} + +func (w *WorkflowRunCollection) SetData(data []WorkflowRun) { + w.Data = data +} + +func (w *WorkflowRunCollection) GetLinks() *shared.Links { + if w == nil { + return nil + } + return w.Links +} + +func (w *WorkflowRunCollection) SetLinks(links shared.Links) { + w.Links = &links +} + +func (w WorkflowRunCollection) String() string { + jsonData, err := json.MarshalIndent(w, "", " ") + if err != nil { + return "error converting struct: WorkflowRunCollection to string" + } + return string(jsonData) +} diff --git a/pkg/project-client/workflows/workflows_service.go b/pkg/project-client/workflows/workflows_service.go new file mode 100644 index 0000000..c811472 --- /dev/null +++ b/pkg/project-client/workflows/workflows_service.go @@ -0,0 +1,156 @@ +package workflows + +import ( + "context" + restClient "github.com/magicbell/magicbell-go/pkg/project-client/internal/clients/rest" + "github.com/magicbell/magicbell-go/pkg/project-client/internal/clients/rest/httptransport" + "github.com/magicbell/magicbell-go/pkg/project-client/internal/configmanager" + "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig" + "github.com/magicbell/magicbell-go/pkg/project-client/shared" + "time" +) + +type WorkflowsService struct { + manager *configmanager.ConfigManager +} + +func NewWorkflowsService() *WorkflowsService { + return &WorkflowsService{ + manager: configmanager.NewConfigManager(clientconfig.Config{}), + } +} + +func (api *WorkflowsService) WithConfigManager(manager *configmanager.ConfigManager) *WorkflowsService { + api.manager = manager + return api +} + +func (api *WorkflowsService) getConfig() *clientconfig.Config { + return api.manager.GetWorkflows() +} + +func (api *WorkflowsService) SetBaseUrl(baseUrl string) { + config := api.getConfig() + config.SetBaseUrl(baseUrl) +} + +func (api *WorkflowsService) SetTimeout(timeout time.Duration) { + config := api.getConfig() + config.SetTimeout(timeout) +} + +func (api *WorkflowsService) SetAccessToken(accessToken string) { + config := api.getConfig() + config.SetAccessToken(accessToken) +} + +// Creates or updates a workflow definition for the project +func (api *WorkflowsService) SaveWorkflow(ctx context.Context, workflowDefinition WorkflowDefinition) (*shared.ClientResponse[WorkflowDefinition], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("PUT"). + WithPath("/workflows"). + WithConfig(config). + WithBody(workflowDefinition). + AddHeader("CONTENT-TYPE", "application/json"). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[WorkflowDefinition](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[WorkflowDefinition](err) + } + + return shared.NewClientResponse[WorkflowDefinition](resp), nil +} + +// Retrieves a workflow definition by key +func (api *WorkflowsService) FetchWorkflow(ctx context.Context) (*shared.ClientResponse[WorkflowDefinition], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("GET"). + WithPath("/workflows/*"). + WithConfig(config). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[WorkflowDefinition](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[WorkflowDefinition](err) + } + + return shared.NewClientResponse[WorkflowDefinition](resp), nil +} + +// Executes a workflow with the provided input parameters +func (api *WorkflowsService) CreateWorkflowRun(ctx context.Context, executeWorkflowRequest ExecuteWorkflowRequest) (*shared.ClientResponse[CreateRunResponse], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("POST"). + WithPath("/workflows/runs"). + WithConfig(config). + WithBody(executeWorkflowRequest). + AddHeader("CONTENT-TYPE", "application/json"). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[CreateRunResponse](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[CreateRunResponse](err) + } + + return shared.NewClientResponse[CreateRunResponse](resp), nil +} + +// Retrieves the status and details of a workflow run +func (api *WorkflowsService) FetchWorkflowRun(ctx context.Context, runId string) (*shared.ClientResponse[GetRunResponse], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("GET"). + WithPath("/workflows/runs/{run_id}"). + WithConfig(config). + AddPathParam("run_id", runId). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[GetRunResponse](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[GetRunResponse](err) + } + + return shared.NewClientResponse[GetRunResponse](resp), nil +} + +// Retrieves all runs for a specific workflow +func (api *WorkflowsService) ListWorkflowRuns(ctx context.Context, workflowKey string) (*shared.ClientResponse[WorkflowRunCollection], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("GET"). + WithPath("/workflows/{workflow_key}/runs"). + WithConfig(config). + AddPathParam("workflow_key", workflowKey). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[WorkflowRunCollection](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[WorkflowRunCollection](err) + } + + return shared.NewClientResponse[WorkflowRunCollection](resp), nil +} diff --git a/pkg/user-client/channels/channels_service.go b/pkg/user-client/channels/channels_service.go index c0340a2..d1c098c 100644 --- a/pkg/user-client/channels/channels_service.go +++ b/pkg/user-client/channels/channels_service.go @@ -578,6 +578,50 @@ func (api *ChannelsService) DeleteTeamsToken(ctx context.Context, tokenId string return shared.NewClientResponse[DiscardResult](resp), nil } +// Fetch a user's channel delivery preferences. +func (api *ChannelsService) FetchUserPreferences(ctx context.Context) (*shared.ClientResponse[UserPreferences], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("GET"). + WithPath("/channels/user_preferences"). + WithConfig(config). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[UserPreferences](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[UserPreferences](err) + } + + return shared.NewClientResponse[UserPreferences](resp), nil +} + +// Save a user's channel preferences. +func (api *ChannelsService) SaveUserPreferences(ctx context.Context, userPreferences UserPreferences) (*shared.ClientResponse[any], *shared.ClientError) { + config := *api.getConfig() + + request := httptransport.NewRequestBuilder().WithContext(ctx). + WithMethod("PUT"). + WithPath("/channels/user_preferences"). + WithConfig(config). + WithBody(userPreferences). + AddHeader("CONTENT-TYPE", "application/json"). + WithContentType(httptransport.ContentTypeJson). + WithResponseContentType(httptransport.ContentTypeJson). + Build() + + client := restClient.NewRestClient[any](config) + resp, err := client.Call(*request) + if err != nil { + return nil, shared.NewClientError[any](err) + } + + return shared.NewClientResponse[any](resp), nil +} + // Lists all Web Push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata. func (api *ChannelsService) ListWebPushTokens(ctx context.Context, params ListWebPushTokensRequestParams) (*shared.ClientResponse[WebPushTokenCollection], *shared.ClientError) { config := *api.getConfig() diff --git a/pkg/user-client/channels/user_preferences.go b/pkg/user-client/channels/user_preferences.go new file mode 100644 index 0000000..8c53097 --- /dev/null +++ b/pkg/user-client/channels/user_preferences.go @@ -0,0 +1,120 @@ +package channels + +import ( + "encoding/json" + "github.com/magicbell/magicbell-go/pkg/user-client/internal/unmarshal" + "github.com/magicbell/magicbell-go/pkg/user-client/util" +) + +type UserPreferences struct { + Categories []Categories `json:"categories,omitempty"` +} + +func (u *UserPreferences) GetCategories() []Categories { + if u == nil { + return nil + } + return u.Categories +} + +func (u *UserPreferences) SetCategories(categories []Categories) { + u.Categories = categories +} + +func (u UserPreferences) String() string { + jsonData, err := json.MarshalIndent(u, "", " ") + if err != nil { + return "error converting struct: UserPreferences to string" + } + return string(jsonData) +} + +type Categories struct { + Channels []Channels `json:"channels,omitempty"` + Key *string `json:"key,omitempty" maxLength:"255" pattern:"^[A-Za-z0-9_\.\-/:]+$"` + Label *util.Nullable[string] `json:"label,omitempty" maxLength:"255"` +} + +func (c *Categories) GetChannels() []Channels { + if c == nil { + return nil + } + return c.Channels +} + +func (c *Categories) SetChannels(channels []Channels) { + c.Channels = channels +} + +func (c *Categories) GetKey() *string { + if c == nil { + return nil + } + return c.Key +} + +func (c *Categories) SetKey(key string) { + c.Key = &key +} + +func (c *Categories) GetLabel() *util.Nullable[string] { + if c == nil { + return nil + } + return c.Label +} + +func (c *Categories) SetLabel(label util.Nullable[string]) { + c.Label = &label +} + +func (c *Categories) SetLabelNull() { + c.Label = &util.Nullable[string]{IsNull: true} +} + +func (c Categories) String() string { + jsonData, err := json.MarshalIndent(c, "", " ") + if err != nil { + return "error converting struct: Categories to string" + } + return string(jsonData) +} + +func (c *Categories) UnmarshalJSON(data []byte) error { + return unmarshal.UnmarshalNullable(data, c) +} + +type Channels struct { + Enabled *bool `json:"enabled,omitempty"` + Name *string `json:"name,omitempty"` +} + +func (c *Channels) GetEnabled() *bool { + if c == nil { + return nil + } + return c.Enabled +} + +func (c *Channels) SetEnabled(enabled bool) { + c.Enabled = &enabled +} + +func (c *Channels) GetName() *string { + if c == nil { + return nil + } + return c.Name +} + +func (c *Channels) SetName(name string) { + c.Name = &name +} + +func (c Channels) String() string { + jsonData, err := json.MarshalIndent(c, "", " ") + if err != nil { + return "error converting struct: Channels to string" + } + return string(jsonData) +} diff --git a/pkg/user-client/internal/clients/rest/httptransport/error_response.go b/pkg/user-client/internal/clients/rest/httptransport/error_response.go index 0da26fe..cebf422 100644 --- a/pkg/user-client/internal/clients/rest/httptransport/error_response.go +++ b/pkg/user-client/internal/clients/rest/httptransport/error_response.go @@ -1,6 +1,9 @@ package httptransport -import "fmt" +import ( + "fmt" + "net/http" +) type ErrorResponse[T any] struct { Err error @@ -9,6 +12,7 @@ type ErrorResponse[T any] struct { Headers map[string]string Body []byte Data T + Raw *http.Response } func NewErrorResponse[T any](err error, resp *Response[T]) *ErrorResponse[T] { @@ -26,6 +30,7 @@ func NewErrorResponse[T any](err error, resp *Response[T]) *ErrorResponse[T] { Headers: resp.Headers, Body: resp.Body, Data: resp.Data, + Raw: resp.Raw, } } diff --git a/pkg/user-client/internal/clients/rest/httptransport/response.go b/pkg/user-client/internal/clients/rest/httptransport/response.go index 6cb54df..e68f213 100644 --- a/pkg/user-client/internal/clients/rest/httptransport/response.go +++ b/pkg/user-client/internal/clients/rest/httptransport/response.go @@ -10,6 +10,7 @@ type Response[T any] struct { Headers map[string]string Body []byte Data T + Raw *http.Response } func (r *Response[T]) Clone() Response[T] { @@ -46,6 +47,7 @@ func NewResponse[T any](resp *http.Response) (*Response[T], error) { Headers: responseHeaders, Body: body, Data: *placeholderData, + Raw: resp, }, nil } diff --git a/pkg/user-client/internal/contenttypes/from_binary.go b/pkg/user-client/internal/contenttypes/from_binary.go index d1272fe..502e770 100644 --- a/pkg/user-client/internal/contenttypes/from_binary.go +++ b/pkg/user-client/internal/contenttypes/from_binary.go @@ -2,12 +2,23 @@ package contenttypes import ( "fmt" + "reflect" ) func FromBinary(data any, target any) error { + targetValue := reflect.ValueOf(target) + + if targetValue.Kind() != reflect.Ptr || targetValue.IsNil() { + return fmt.Errorf("target must be a non-nil pointer") + } + + targetValue = targetValue.Elem() + if b, ok := data.([]byte); ok { - target = &b - return nil + if targetValue.Kind() == reflect.Slice && targetValue.Type().Elem().Kind() == reflect.Uint8 { + targetValue.Set(reflect.ValueOf(b)) + return nil + } } return fmt.Errorf("Failed to convert response body to byte array") diff --git a/pkg/user-client/shared/client_error.go b/pkg/user-client/shared/client_error.go index 115c7c4..29a1cbe 100644 --- a/pkg/user-client/shared/client_error.go +++ b/pkg/user-client/shared/client_error.go @@ -2,11 +2,13 @@ package shared import ( "github.com/magicbell/magicbell-go/pkg/user-client/internal/clients/rest/httptransport" + "net/http" ) type ClientError struct { Err error Body []byte + Raw *http.Response Metadata ClientErrorMetadata } @@ -19,6 +21,7 @@ func NewClientError[T any](transportError *httptransport.ErrorResponse[T]) *Clie return &ClientError{ Err: transportError.GetError(), Body: transportError.GetBody(), + Raw: transportError.Raw, Metadata: ClientErrorMetadata{ StatusCode: transportError.GetStatusCode(), Headers: transportError.GetHeaders(), diff --git a/pkg/user-client/shared/client_response.go b/pkg/user-client/shared/client_response.go index 244f389..bec8102 100644 --- a/pkg/user-client/shared/client_response.go +++ b/pkg/user-client/shared/client_response.go @@ -2,12 +2,13 @@ package shared import ( "encoding/json" - "github.com/magicbell/magicbell-go/pkg/user-client/internal/clients/rest/httptransport" + "net/http" ) type ClientResponse[T any] struct { Data T + Raw *http.Response Metadata ClientResponseMetadata } @@ -19,6 +20,7 @@ type ClientResponseMetadata struct { func NewClientResponse[T any](resp *httptransport.Response[T]) *ClientResponse[T] { return &ClientResponse[T]{ Data: resp.Data, + Raw: resp.Raw, Metadata: ClientResponseMetadata{ StatusCode: resp.StatusCode, Headers: resp.Headers, diff --git a/pkg/user-client/shared/web_push_token_payload.go b/pkg/user-client/shared/web_push_token_payload.go index 0b241fe..f9e78a9 100644 --- a/pkg/user-client/shared/web_push_token_payload.go +++ b/pkg/user-client/shared/web_push_token_payload.go @@ -38,41 +38,3 @@ func (w WebPushTokenPayload) String() string { } return string(jsonData) } - -// The encryption keys from the PushSubscription.getKey() method, needed to encrypt push messages for this subscription. -type WebPushTokenPayloadKeys struct { - // The authentication secret obtained from PushSubscription.getKey('auth'). Used to encrypt push messages for this subscription. - Auth *string `json:"auth,omitempty" required:"true"` - // The P-256 ECDH public key obtained from PushSubscription.getKey('p256dh'). Used to encrypt push messages for this subscription. - P256dh *string `json:"p256dh,omitempty" required:"true"` -} - -func (w *WebPushTokenPayloadKeys) GetAuth() *string { - if w == nil { - return nil - } - return w.Auth -} - -func (w *WebPushTokenPayloadKeys) SetAuth(auth string) { - w.Auth = &auth -} - -func (w *WebPushTokenPayloadKeys) GetP256dh() *string { - if w == nil { - return nil - } - return w.P256dh -} - -func (w *WebPushTokenPayloadKeys) SetP256dh(p256dh string) { - w.P256dh = &p256dh -} - -func (w WebPushTokenPayloadKeys) String() string { - jsonData, err := json.MarshalIndent(w, "", " ") - if err != nil { - return "error converting struct: WebPushTokenPayloadKeys to string" - } - return string(jsonData) -}