-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e87a6c0
commit e22704a
Showing
222 changed files
with
21,945 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.changeset/auto-bump-magicbell-go-project-client-1734645640.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"magicbell-go-project-client": minor | ||
--- | ||
|
||
Automatic minor version bump for changes in `magicbell-go-project-client`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
# MagicbellProjectClient Go SDK 0.0.0 | ||
|
||
Welcome to the MagicbellProjectClient SDK documentation. This guide will help you get started with integrating and using the MagicbellProjectClient SDK in your project. | ||
|
||
[![This SDK was generated by liblab](https://public-liblab-readme-assets.s3.us-east-1.amazonaws.com/built-by-liblab-icon.svg)](https://liblab.com/?utm_source=readme) | ||
|
||
## Versions | ||
|
||
- API version: `2.0.0` | ||
- SDK version: `0.0.0` | ||
|
||
## About the API | ||
|
||
OpenAPI 3.0.3 Specification for MagicBell API. | ||
|
||
## Table of Contents | ||
|
||
- [Setup & Configuration](#setup--configuration) | ||
- [Supported Language Versions](#supported-language-versions) | ||
- [Installation](#installation) | ||
- [Authentication](#authentication) | ||
- [Access Token Authentication](#access-token-authentication) | ||
- [Services](#services) | ||
- [Response Wrappers](#response-wrappers) | ||
- [Models](#models) | ||
- [License](#license) | ||
|
||
# Setup & Configuration | ||
|
||
## Supported Language Versions | ||
|
||
This SDK is compatible with the following versions: `Go >= 1.19.0` | ||
|
||
## Authentication | ||
|
||
### Access Token Authentication | ||
|
||
The magicbell-project-client API uses an Access Token for authentication. | ||
|
||
This token must be provided to authenticate your requests to the API. | ||
|
||
#### Setting the Access Token | ||
|
||
When you initialize the SDK, you can set the access token as follows: | ||
|
||
```go | ||
import ( | ||
"github.com/magicbell/magicbell-go-project-client/pkg/magicbellprojectclient" | ||
"github.com/magicbell/magicbell-go-project-client/pkg/magicbellprojectclientconfig" | ||
) | ||
|
||
config := magicbellprojectclientconfig.NewConfig() | ||
config.SetAccessToken("YOUR-TOKEN") | ||
|
||
sdk := magicbellprojectclient.NewMagicbellProjectClient(config) | ||
``` | ||
|
||
If you need to set or update the access token after initializing the SDK, you can use: | ||
|
||
```go | ||
import ( | ||
"github.com/magicbell/magicbell-go-project-client/pkg/magicbellprojectclient" | ||
"github.com/magicbell/magicbell-go-project-client/pkg/magicbellprojectclientconfig" | ||
) | ||
|
||
config := magicbellprojectclientconfig.NewConfig() | ||
|
||
sdk := magicbellprojectclient.NewMagicbellProjectClient(config) | ||
sdk.SetAccessToken("YOUR-TOKEN") | ||
``` | ||
|
||
## Services | ||
|
||
The SDK provides various services to interact with the API. | ||
|
||
<details> | ||
<summary>Below is a list of all available services with links to their detailed documentation:</summary> | ||
|
||
| Name | | ||
| :-------------------------------------------------------------------- | | ||
| [BroadcastsService](documentation/services/broadcasts_service.md) | | ||
| [ChannelsService](documentation/services/channels_service.md) | | ||
| [EventsService](documentation/services/events_service.md) | | ||
| [IntegrationsService](documentation/services/integrations_service.md) | | ||
| [JwtService](documentation/services/jwt_service.md) | | ||
|
||
</details> | ||
|
||
### Response Wrappers | ||
|
||
All services use response wrappers to provide a consistent interface to return the responses from the API. | ||
|
||
The response wrapper itself is a generic struct that contains the response data and metadata. | ||
|
||
<details> | ||
<summary>Below are the response wrappers used in the SDK:</summary> | ||
|
||
#### `MagicbellProjectClientResponse[T]` | ||
|
||
This response wrapper is used to return the response data from the API. It contains the following fields: | ||
|
||
| Name | Type | Description | | ||
| :------- | :--------------------------------------- | :------------------------------------------ | | ||
| Data | `T` | The body of the API response | | ||
| Metadata | `MagicbellProjectClientResponseMetadata` | Status code and headers returned by the API | | ||
|
||
#### `MagicbellProjectClientError` | ||
|
||
This response wrapper is used to return an error. It contains the following fields: | ||
|
||
| Name | Type | Description | | ||
| :------- | :--------------------------------------- | :------------------------------------------ | | ||
| Err | `error` | The error that occurred | | ||
| Body | `T` | The body of the API response | | ||
| Metadata | `MagicbellProjectClientResponseMetadata` | Status code and headers returned by the API | | ||
|
||
#### `MagicbellProjectClientResponseMetadata` | ||
|
||
This struct is shared by both response wrappers and contains the following fields: | ||
|
||
| Name | Type | Description | | ||
| :--------- | :------------------ | :----------------------------------------------- | | ||
| Headers | `map[string]string` | A map containing the headers returned by the API | | ||
| StatusCode | `int` | The status code returned by the API | | ||
|
||
</details> | ||
|
||
## Models | ||
|
||
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. | ||
|
||
<details> | ||
<summary>Below is a list of all available models with links to their detailed documentation:</summary> | ||
|
||
| Name | Description | | ||
| :------------------------------------------------------------------------------------------------ | :---------- | | ||
| [ArrayOfBroadcasts](documentation/models/array_of_broadcasts.md) | | | ||
| [Broadcast](documentation/models/broadcast.md) | | | ||
| [ProjectDeliveryConfig](documentation/models/project_delivery_config.md) | | | ||
| [CategoryDeliveryConfig](documentation/models/category_delivery_config.md) | | | ||
| [ArrayOfMetadataApnsTokens](documentation/models/array_of_metadata_apns_tokens.md) | | | ||
| [MetadataApnsToken](documentation/models/metadata_apns_token.md) | | | ||
| [DiscardResult](documentation/models/discard_result.md) | | | ||
| [ArrayOfMetadataExpoTokens](documentation/models/array_of_metadata_expo_tokens.md) | | | ||
| [MetadataExpoToken](documentation/models/metadata_expo_token.md) | | | ||
| [ArrayOfMetadataFcmTokens](documentation/models/array_of_metadata_fcm_tokens.md) | | | ||
| [MetadataFcmToken](documentation/models/metadata_fcm_token.md) | | | ||
| [ArrayOfMetadataSlackTokens](documentation/models/array_of_metadata_slack_tokens.md) | | | ||
| [MetadataSlackToken](documentation/models/metadata_slack_token.md) | | | ||
| [ArrayOfMetadataTeamsTokens](documentation/models/array_of_metadata_teams_tokens.md) | | | ||
| [MetadataTeamsToken](documentation/models/metadata_teams_token.md) | | | ||
| [ArrayOfMetadataWebPushTokens](documentation/models/array_of_metadata_web_push_tokens.md) | | | ||
| [MetadataWebPushToken](documentation/models/metadata_web_push_token.md) | | | ||
| [ArrayOfEvents](documentation/models/array_of_events.md) | | | ||
| [ArrayOfIntegrationObjects](documentation/models/array_of_integration_objects.md) | | | ||
| [ArrayOfApnsConfigObjects](documentation/models/array_of_apns_config_objects.md) | | | ||
| [ApnsConfig](documentation/models/apns_config.md) | | | ||
| [ArrayOfAwssnsConfigObjects](documentation/models/array_of_awssns_config_objects.md) | | | ||
| [AwssnsConfig](documentation/models/awssns_config.md) | | | ||
| [ArrayOfExpoConfigObjects](documentation/models/array_of_expo_config_objects.md) | | | ||
| [ExpoConfig](documentation/models/expo_config.md) | | | ||
| [ArrayOfFcmConfigObjects](documentation/models/array_of_fcm_config_objects.md) | | | ||
| [FcmConfig](documentation/models/fcm_config.md) | | | ||
| [ArrayOfGithubConfigObjects](documentation/models/array_of_github_config_objects.md) | | | ||
| [GithubConfig](documentation/models/github_config.md) | | | ||
| [ArrayOfInboxConfigObjects](documentation/models/array_of_inbox_config_objects.md) | | | ||
| [InboxConfig](documentation/models/inbox_config.md) | | | ||
| [ArrayOfMailgunConfigObjects](documentation/models/array_of_mailgun_config_objects.md) | | | ||
| [MailgunConfig](documentation/models/mailgun_config.md) | | | ||
| [ArrayOfPingConfigObjects](documentation/models/array_of_ping_config_objects.md) | | | ||
| [PingConfig](documentation/models/ping_config.md) | | | ||
| [ArrayOfSendgridConfigObjects](documentation/models/array_of_sendgrid_config_objects.md) | | | ||
| [SendgridConfig](documentation/models/sendgrid_config.md) | | | ||
| [ArrayOfSesConfigObjects](documentation/models/array_of_ses_config_objects.md) | | | ||
| [SesConfig](documentation/models/ses_config.md) | | | ||
| [ArrayOfSlackConfigObjects](documentation/models/array_of_slack_config_objects.md) | | | ||
| [SlackConfig](documentation/models/slack_config.md) | | | ||
| [ArrayOfStripeConfigObjects](documentation/models/array_of_stripe_config_objects.md) | | | ||
| [StripeConfig](documentation/models/stripe_config.md) | | | ||
| [ArrayOfTemplatesConfigObjects](documentation/models/array_of_templates_config_objects.md) | | | ||
| [ArrayOfTwilioConfigObjects](documentation/models/array_of_twilio_config_objects.md) | | | ||
| [TwilioConfig](documentation/models/twilio_config.md) | | | ||
| [ArrayOfWebpushConfigObjects](documentation/models/array_of_webpush_config_objects.md) | | | ||
| [WebpushConfig](documentation/models/webpush_config.md) | | | ||
| [ArrayOfFetchTokensResponseTokens](documentation/models/array_of_fetch_tokens_response_tokens.md) | | | ||
| [CreateProjectTokenRequest](documentation/models/create_project_token_request.md) | | | ||
| [AccessToken](documentation/models/access_token.md) | | | ||
| [DiscardTokenResponse](documentation/models/discard_token_response.md) | | | ||
| [CreateUserTokenRequest](documentation/models/create_user_token_request.md) | | | ||
| [Links](documentation/models/links.md) | | | ||
| [ApnsToken](documentation/models/apns_token.md) | | | ||
| [TokenMetadata](documentation/models/token_metadata.md) | | | ||
| [ExpoToken](documentation/models/expo_token.md) | | | ||
| [FcmToken](documentation/models/fcm_token.md) | | | ||
| [SlackToken](documentation/models/slack_token.md) | | | ||
| [TeamsToken](documentation/models/teams_token.md) | | | ||
| [WebPushToken](documentation/models/web_push_token.md) | | | ||
| [Event](documentation/models/event.md) | | | ||
| [IntegrationObject](documentation/models/integration_object.md) | | | ||
| [ApnsConfigObject](documentation/models/apns_config_object.md) | | | ||
| [AwssnsConfigObject](documentation/models/awssns_config_object.md) | | | ||
| [ExpoConfigObject](documentation/models/expo_config_object.md) | | | ||
| [FcmConfigObject](documentation/models/fcm_config_object.md) | | | ||
| [GithubConfigObject](documentation/models/github_config_object.md) | | | ||
| [InboxConfigObject](documentation/models/inbox_config_object.md) | | | ||
| [MailgunConfigObject](documentation/models/mailgun_config_object.md) | | | ||
| [PingConfigObject](documentation/models/ping_config_object.md) | | | ||
| [SendgridConfigObject](documentation/models/sendgrid_config_object.md) | | | ||
| [SesConfigObject](documentation/models/ses_config_object.md) | | | ||
| [SlackConfigObject](documentation/models/slack_config_object.md) | | | ||
| [StripeConfigObject](documentation/models/stripe_config_object.md) | | | ||
| [TemplatesConfigObject](documentation/models/templates_config_object.md) | | | ||
| [TwilioConfigObject](documentation/models/twilio_config_object.md) | | | ||
| [WebpushConfigObject](documentation/models/webpush_config_object.md) | | | ||
| [FetchTokensResponseToken](documentation/models/fetch_tokens_response_token.md) | | | ||
|
||
</details> | ||
|
||
## License | ||
|
||
This SDK is licensed under the MIT License. | ||
|
||
See the [LICENSE](LICENSE) file for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/magicbell/magicbell-go-project-client/pkg/broadcasts" | ||
"github.com/magicbell/magicbell-go-project-client/pkg/magicbellprojectclient" | ||
"github.com/magicbell/magicbell-go-project-client/pkg/magicbellprojectclientconfig" | ||
) | ||
|
||
func main() { | ||
config := magicbellprojectclientconfig.NewConfig() | ||
client := magicbellprojectclient.NewMagicbellProjectClient(config) | ||
|
||
params := broadcasts.ListBroadcastsRequestParams{} | ||
|
||
response, err := client.Broadcasts.ListBroadcasts(context.Background(), params) | ||
if err != nil { | ||
panic(err) | ||
} | ||
fmt.Printf("%+v", response) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# AccessToken | ||
|
||
**Properties** | ||
|
||
| Name | Type | Required | Description | | ||
| :-------- | :----- | :------- | :---------- | | ||
| CreatedAt | string | ✅ | | | ||
| Token | string | ✅ | | | ||
| TokenId | string | ✅ | | | ||
| ExpiresAt | string | ❌ | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# ApnsConfig | ||
|
||
**Properties** | ||
|
||
| Name | Type | Required | Description | | ||
| :------------- | :-------------------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| AppId | string | ✅ | The default bundle identifier of the application that is configured with this project. It can be overriden on a per token basis, when registering device tokens. | | ||
| Badge | integrations.Badge | ✅ | | | ||
| Certificate | string | ✅ | The APNs certificate in P8 format. Generate it at [developer.apple.com](https://developer.apple.com/account/resources/authkeys/add) with the 'Apple Push Notification service (APNs)' option selected. | | ||
| KeyId | string | ✅ | | | ||
| TeamId | string | ✅ | | | ||
| PayloadVersion | integrations.PayloadVersion | ❌ | | | ||
|
||
# Badge | ||
|
||
**Properties** | ||
|
||
| Name | Type | Required | Description | | ||
| :----- | :----- | :------- | :---------- | | ||
| unread | string | ✅ | "unread" | | ||
| unseen | string | ✅ | "unseen" | | ||
|
||
# PayloadVersion | ||
|
||
**Properties** | ||
|
||
| Name | Type | Required | Description | | ||
| :--- | :----- | :------- | :---------- | | ||
| \_1 | string | ✅ | "1" | | ||
| \_2 | string | ✅ | "2" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ApnsConfigObject | ||
|
||
**Properties** | ||
|
||
| Name | Type | Required | Description | | ||
| :----- | :---------------------- | :------- | :---------- | | ||
| Config | integrations.ApnsConfig | ✅ | | | ||
| Id | string | ✅ | | | ||
| Name | string | ✅ | | |
Oops, something went wrong.