@@ -8,6 +8,14 @@ title: "project-client"
88
99This SDK is compatible with the following versions: ` Go >= 1.19.0 `
1010
11+ ## Installation
12+
13+ To get started with the SDK, we recommend installing using ` go get ` :
14+
15+ ``` bash
16+ go get client
17+ ```
18+
1119## Authentication
1220
1321### Access Token Authentication
@@ -46,11 +54,60 @@ sdk := client.NewClient(config)
4654sdk.SetAccessToken (" YOUR-TOKEN" )
4755```
4856
57+ ## Setting a Custom Timeout
58+
59+ You can set a custom timeout for the SDK's HTTP requests as follows:
60+
61+ ``` go
62+ import " time"
63+
64+ config := clientconfig.NewConfig ()
65+
66+ sdk := client.NewClient (config)
67+
68+ sdk.SetTimeout (10 * time.Second )
69+ ```
70+
71+ # Sample Usage
72+
73+ Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:
74+
75+ ``` go
76+ import (
77+ " fmt"
78+ " encoding/json"
79+ " context"
80+ " github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
81+ " github.com/magicbell/magicbell-go/pkg/project-client/client"
82+ " github.com/magicbell/magicbell-go/pkg/project-client/util"
83+ " github.com/magicbell/magicbell-go/pkg/project-client/broadcasts"
84+ )
85+
86+ config := clientconfig.NewConfig ()
87+ config.SetAccessToken (" ACCESS_TOKEN" )
88+ client := client.NewClient (config)
89+
90+
91+ params := broadcasts.ListBroadcastsRequestParams {
92+ Limit : util.ToPointer (int64 (8 )),
93+ StartingAfter : util.ToPointer (" starting_after" ),
94+ EndingBefore : util.ToPointer (" ending_before" ),
95+ }
96+
97+ response , err := client.Broadcasts .ListBroadcasts (context.Background (), params)
98+ if err != nil {
99+ panic (err)
100+ }
101+
102+ fmt.Println (response)
103+
104+ ```
105+
49106## Services
50107
51108The SDK provides various services to interact with the API.
52109
53- <details >
110+ <details >
54111<summary >Below is a list of all available services with links to their detailed documentation:</summary >
55112
56113| Name |
@@ -60,6 +117,7 @@ The SDK provides various services to interact with the API.
60117| [ EventsService] ( services/events_service.md ) |
61118| [ IntegrationsService] ( services/integrations_service.md ) |
62119| [ UsersService] ( services/users_service.md ) |
120+ | [ WorkflowsService] ( services/workflows_service.md ) |
63121
64122</details >
65123
@@ -106,16 +164,19 @@ This struct is shared by both response wrappers and contains the following field
106164
107165The 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.
108166
109- <details >
167+ <details >
110168<summary >Below is a list of all available models with links to their detailed documentation:</summary >
111169
112170| Name | Description |
113171| :-------------------------------------------------------------------------------------- | :---------- |
114172| [ BroadcastCollection] ( models/broadcast_collection.md ) | |
115173| [ Broadcast] ( models/broadcast.md ) | |
174+ | [ User] ( models/user.md ) | |
175+ | [ Links] ( models/links.md ) | |
116176| [ CategoryDeliveryConfig] ( models/category_delivery_config.md ) | |
117177| [ InboxTokenResponseCollection] ( models/inbox_token_response_collection.md ) | |
118178| [ InboxTokenResponse] ( models/inbox_token_response.md ) | |
179+ | [ Links] ( models/links.md ) | |
119180| [ DiscardResult] ( models/discard_result.md ) | |
120181| [ ApnsTokenCollection] ( models/apns_token_collection.md ) | |
121182| [ ApnsToken] ( models/apns_token.md ) | |
@@ -131,49 +192,61 @@ The SDK includes several models that represent the data structures used in API r
131192| [ WebPushToken] ( models/web_push_token.md ) | |
132193| [ EventCollection] ( models/event_collection.md ) | |
133194| [ Event] ( models/event.md ) | |
195+ | [ Links] ( models/links.md ) | |
134196| [ IntegrationConfigCollection] ( models/integration_config_collection.md ) | |
197+ | [ IntegrationConfig] ( models/integration_config.md ) | |
198+ | [ Links] ( models/links.md ) | |
135199| [ ApnsConfigCollection] ( models/apns_config_collection.md ) | |
200+ | [ ApnsConfig] ( models/apns_config.md ) | |
136201| [ ApnsConfigPayload] ( models/apns_config_payload.md ) | |
202+ | [ EventSourceConfigCollection] ( models/event_source_config_collection.md ) | |
203+ | [ EventSourceConfig] ( models/event_source_config.md ) | |
204+ | [ EventSourceConfigPayload] ( models/event_source_config_payload.md ) | |
137205| [ ExpoConfigCollection] ( models/expo_config_collection.md ) | |
206+ | [ ExpoConfig] ( models/expo_config.md ) | |
138207| [ ExpoConfigPayload] ( models/expo_config_payload.md ) | |
139208| [ FcmConfigCollection] ( models/fcm_config_collection.md ) | |
209+ | [ FcmConfig] ( models/fcm_config.md ) | |
140210| [ FcmConfigPayload] ( models/fcm_config_payload.md ) | |
141211| [ GithubConfigCollection] ( models/github_config_collection.md ) | |
212+ | [ GithubConfig] ( models/github_config.md ) | |
142213| [ GithubConfigPayload] ( models/github_config_payload.md ) | |
143214| [ InboxConfigCollection] ( models/inbox_config_collection.md ) | |
215+ | [ InboxConfig] ( models/inbox_config.md ) | |
144216| [ InboxConfigPayload] ( models/inbox_config_payload.md ) | |
145217| [ MailgunConfigCollection] ( models/mailgun_config_collection.md ) | |
218+ | [ MailgunConfig] ( models/mailgun_config.md ) | |
146219| [ MailgunConfigPayload] ( models/mailgun_config_payload.md ) | |
147220| [ PingConfigCollection] ( models/ping_config_collection.md ) | |
221+ | [ PingConfig] ( models/ping_config.md ) | |
148222| [ PingConfigPayload] ( models/ping_config_payload.md ) | |
149223| [ SendgridConfigCollection] ( models/sendgrid_config_collection.md ) | |
224+ | [ SendgridConfig] ( models/sendgrid_config.md ) | |
150225| [ SendgridConfigPayload] ( models/sendgrid_config_payload.md ) | |
151226| [ SesConfigCollection] ( models/ses_config_collection.md ) | |
227+ | [ SesConfig] ( models/ses_config.md ) | |
152228| [ SesConfigPayload] ( models/ses_config_payload.md ) | |
153229| [ SlackConfigCollection] ( models/slack_config_collection.md ) | |
230+ | [ SlackConfig] ( models/slack_config.md ) | |
154231| [ SlackConfigPayload] ( models/slack_config_payload.md ) | |
155232| [ StripeConfigCollection] ( models/stripe_config_collection.md ) | |
233+ | [ StripeConfig] ( models/stripe_config.md ) | |
156234| [ StripeConfigPayload] ( models/stripe_config_payload.md ) | |
157235| [ TwilioConfigCollection] ( models/twilio_config_collection.md ) | |
236+ | [ TwilioConfig] ( models/twilio_config.md ) | |
158237| [ TwilioConfigPayload] ( models/twilio_config_payload.md ) | |
159238| [ WebpushConfigCollection] ( models/webpush_config_collection.md ) | |
239+ | [ WebpushConfig] ( models/webpush_config.md ) | |
160240| [ WebpushConfigPayload] ( models/webpush_config_payload.md ) | |
161241| [ UserCollection] ( models/user_collection.md ) | |
162242| [ User] ( models/user.md ) | |
163243| [ Links] ( models/links.md ) | |
164- | [ IntegrationConfig] ( models/integration_config.md ) | |
165- | [ ApnsConfig] ( models/apns_config.md ) | |
166- | [ ExpoConfig] ( models/expo_config.md ) | |
167- | [ FcmConfig] ( models/fcm_config.md ) | |
168- | [ GithubConfig] ( models/github_config.md ) | |
169- | [ InboxConfig] ( models/inbox_config.md ) | |
170- | [ MailgunConfig] ( models/mailgun_config.md ) | |
171- | [ PingConfig] ( models/ping_config.md ) | |
172- | [ SendgridConfig] ( models/sendgrid_config.md ) | |
173- | [ SesConfig] ( models/ses_config.md ) | |
174- | [ SlackConfig] ( models/slack_config.md ) | |
175- | [ StripeConfig] ( models/stripe_config.md ) | |
176- | [ TwilioConfig] ( models/twilio_config.md ) | |
177- | [ WebpushConfig] ( models/webpush_config.md ) | |
244+ | [ WorkflowDefinition] ( models/workflow_definition.md ) | |
245+ | [ ExecuteWorkflowRequest] ( models/execute_workflow_request.md ) | |
246+ | [ CreateRunResponse] ( models/create_run_response.md ) | |
247+ | [ GetRunResponse] ( models/get_run_response.md ) | |
248+ | [ WorkflowRunCollection] ( models/workflow_run_collection.md ) | |
249+ | [ WorkflowRun] ( models/workflow_run.md ) | |
250+ | [ Links] ( models/links.md ) | |
178251
179252</details >
0 commit comments