https://github.com/magicbell/magicbell-go-project-client
https://github.com/magicbell/magicbell-go-project-client
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/magicbell/magicbell-go-project-client
- Owner: magicbell
- License: mit
- Created: 2024-12-19T20:52:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-17T06:01:42.000Z (over 1 year ago)
- Last Synced: 2025-02-22T17:50:11.628Z (over 1 year ago)
- Language: Go
- Size: 187 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MagicbellProjectClient Go SDK 0.1.1
Welcome to the MagicbellProjectClient SDK documentation. This guide will help you get started with integrating and using the MagicbellProjectClient SDK in your project.
[](https://liblab.com/?utm_source=readme)
## Versions
- API version: `2.0.0`
- SDK version: `0.1.1`
## 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.
Below is a list of all available services with links to their detailed documentation:
| 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) |
### 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.
Below are the response wrappers used in the SDK:
#### `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 |
## 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.
Below is a list of all available models with links to their detailed documentation:
| 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) | |
## License
This SDK is licensed under the MIT License.
See the [LICENSE](LICENSE) file for more details.