-
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
Showing
6 changed files
with
2,498 additions
and
0 deletions.
There are no files selected for viewing
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,126 @@ | ||
# NovuNotifications | ||
(*Subscribers.Notifications*) | ||
|
||
## Overview | ||
|
||
### Available Operations | ||
|
||
* [Feed](#feed) - Get in-app notification feed for a particular subscriber | ||
* [UnseenCount](#unseencount) - Get the unseen in-app notifications count for subscribers feed | ||
|
||
## Feed | ||
|
||
Get in-app notification feed for a particular subscriber | ||
|
||
### Example Usage | ||
|
||
```go | ||
package main | ||
|
||
import( | ||
"context" | ||
"os" | ||
novugo "github.com/novuhq/novu-go" | ||
"github.com/novuhq/novu-go/models/operations" | ||
"log" | ||
) | ||
|
||
func main() { | ||
ctx := context.Background() | ||
|
||
s := novugo.New( | ||
novugo.WithSecurity(os.Getenv("NOVU_SECRET_KEY")), | ||
) | ||
|
||
res, err := s.Subscribers.Notifications.Feed(ctx, operations.SubscribersV1ControllerGetNotificationsFeedRequest{ | ||
SubscriberID: "<id>", | ||
Payload: novugo.String("btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30="), | ||
}) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
if res.FeedResponseDto != nil { | ||
// handle response | ||
} | ||
} | ||
``` | ||
|
||
### Parameters | ||
|
||
| Parameter | Type | Required | Description | | ||
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | ||
| `request` | [operations.SubscribersV1ControllerGetNotificationsFeedRequest](../../models/operations/subscribersv1controllergetnotificationsfeedrequest.md) | :heavy_check_mark: | The request object to use for the request. | | ||
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | ||
|
||
### Response | ||
|
||
**[*operations.SubscribersV1ControllerGetNotificationsFeedResponse](../../models/operations/subscribersv1controllergetnotificationsfeedresponse.md), error** | ||
|
||
### Errors | ||
|
||
| Error Type | Status Code | Content Type | | ||
| -------------------------------------- | -------------------------------------- | -------------------------------------- | | ||
| apierrors.ErrorDto | 414 | application/json | | ||
| apierrors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | | ||
| apierrors.ValidationErrorDto | 422 | application/json | | ||
| apierrors.ErrorDto | 500 | application/json | | ||
| apierrors.APIError | 4XX, 5XX | \*/\* | | ||
|
||
## UnseenCount | ||
|
||
Get the unseen in-app notifications count for subscribers feed | ||
|
||
### Example Usage | ||
|
||
```go | ||
package main | ||
|
||
import( | ||
"context" | ||
"os" | ||
novugo "github.com/novuhq/novu-go" | ||
"log" | ||
) | ||
|
||
func main() { | ||
ctx := context.Background() | ||
|
||
s := novugo.New( | ||
novugo.WithSecurity(os.Getenv("NOVU_SECRET_KEY")), | ||
) | ||
|
||
res, err := s.Subscribers.Notifications.UnseenCount(ctx, "<id>", nil, nil, nil) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
if res.UnseenCountResponse != nil { | ||
// handle response | ||
} | ||
} | ||
``` | ||
|
||
### Parameters | ||
|
||
| Parameter | Type | Required | Description | | ||
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | | ||
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | ||
| `subscriberID` | *string* | :heavy_check_mark: | N/A | | ||
| `seen` | **bool* | :heavy_minus_sign: | Indicates whether to count seen notifications. | | ||
| `limit` | **float64* | :heavy_minus_sign: | The maximum number of notifications to return. | | ||
| `idempotencyKey` | **string* | :heavy_minus_sign: | A header for idempotency purposes | | ||
| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | ||
|
||
### Response | ||
|
||
**[*operations.SubscribersV1ControllerGetUnseenCountResponse](../../models/operations/subscribersv1controllergetunseencountresponse.md), error** | ||
|
||
### Errors | ||
|
||
| Error Type | Status Code | Content Type | | ||
| -------------------------------------- | -------------------------------------- | -------------------------------------- | | ||
| apierrors.ErrorDto | 414 | application/json | | ||
| apierrors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | | ||
| apierrors.ValidationErrorDto | 422 | application/json | | ||
| apierrors.ErrorDto | 500 | application/json | | ||
| apierrors.APIError | 4XX, 5XX | \*/\* | |
Oops, something went wrong.