diff --git a/.secrets.baseline b/.secrets.baseline index 7bc8d24..cae320a 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2023-01-27T15:07:26Z", + "generated_at": "2023-02-17T05:43:00Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -110,7 +110,7 @@ "hashed_secret": "811424347556b661512671f7a53aafa6aaf03ca2", "is_secret": false, "is_verified": false, - "line_number": 41, + "line_number": 42, "type": "Secret Keyword", "verified_result": null }, @@ -118,7 +118,7 @@ "hashed_secret": "e8e75379ccc030eb8ec988a993ef3c6e6cbd9c98", "is_secret": false, "is_verified": false, - "line_number": 154, + "line_number": 178, "type": "Secret Keyword", "verified_result": null }, @@ -126,7 +126,7 @@ "hashed_secret": "4b0873b633484d5de20b2d8f852a8c07b43336bc", "is_secret": false, "is_verified": false, - "line_number": 532, + "line_number": 556, "type": "Secret Keyword", "verified_result": null }, @@ -134,7 +134,7 @@ "hashed_secret": "76093020087344732c40421926f0a97a6cccc17e", "is_secret": false, "is_verified": false, - "line_number": 1159, + "line_number": 1207, "type": "Secret Keyword", "verified_result": null } @@ -144,7 +144,7 @@ "hashed_secret": "e8e75379ccc030eb8ec988a993ef3c6e6cbd9c98", "is_secret": false, "is_verified": false, - "line_number": 165, + "line_number": 188, "type": "Secret Keyword", "verified_result": null }, @@ -152,7 +152,7 @@ "hashed_secret": "4b0873b633484d5de20b2d8f852a8c07b43336bc", "is_secret": false, "is_verified": false, - "line_number": 627, + "line_number": 650, "type": "Secret Keyword", "verified_result": null } @@ -170,7 +170,7 @@ "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 8429, + "line_number": 8422, "type": "Secret Keyword", "verified_result": null } diff --git a/.travis.yml b/.travis.yml index 22c1988..72dc85c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,9 @@ language: go dist: bionic go: -- 1.16.x -- 1.17.x +- 1.18.x +- 1.19.x +- 1.20.x notifications: email: true @@ -18,8 +19,8 @@ before_install: - pyenv global 3.8 install: - - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.41.1 - - curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.1 + - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.2 + - curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin script: - make travis-ci @@ -35,5 +36,5 @@ deploy: script: npm run semantic-release skip_cleanup: true on: - go: '1.16.x' + go: '1.18.x' branch: main diff --git a/Makefile b/Makefile index 45840b9..1fda324 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ COVERAGE = -coverprofile=coverage.txt -covermode=atomic all: tidy test lint -travis-ci: test-cov lint scan-gosec tidy +travis-ci: tidy test-cov lint scan-gosec test: go test `go list ./...` diff --git a/README.md b/README.md index 633b838..359ba4f 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Service Name | Package name * An [IBM Cloud][ibm-cloud-onboarding] account. * An Event Notifications Instance -* Go version 1.16 or above. +* Go version 1.18 or above. ## Installation Install using the command. @@ -671,7 +671,7 @@ notificationsSouce := "" specVersion := "1.0" notificationDevicesModel := "{\"user_ids\": [\"userId\"]}" -notificationFcmBodyModel := "{\"title\" : \"Portugal vs. Denmark\", \"badge\": \"great match\"}" +notificationFcmBodyModel := "{\"message\": {\"android\": {\"notification\": {\"title\": \"Alert message\",\"body\": \"Bob wants to play Poker\"},\"data\": {\"name\": \"Willie Greenholt\",\"description\": \"notification for the Poker\"}}}}" notificationAPNsBodyModel := "{\"alert\": \"Game Request\", \"badge\": 5 }" notificationSafariBodyModel := "{\"aps\":{\"alert\":{\"title\":\"FlightA998NowBoarding\",\"body\":\"BoardinghasbegunforFlightA998.\",\"action\":\"View\"},\"url-args\":[\"boarding\",\"A998\"]}}}" diff --git a/eventnotificationsv1/event_notifications_v1.go b/eventnotificationsv1/event_notifications_v1.go index 5def666..c04fb42 100644 --- a/eventnotificationsv1/event_notifications_v1.go +++ b/eventnotificationsv1/event_notifications_v1.go @@ -1351,8 +1351,8 @@ func (eventNotifications *EventNotificationsV1) DeleteDestinationWithContext(ctx return } -// CreateTagsSubscription : Create a new Tag subscription -// Create a new Tag subscription. +// CreateTagsSubscription : Create a new tag subscription +// Create a new tag subscription. func (eventNotifications *EventNotificationsV1) CreateTagsSubscription(createTagsSubscriptionOptions *CreateTagsSubscriptionOptions) (result *DestinationTagsSubscriptionResponse, response *core.DetailedResponse, err error) { return eventNotifications.CreateTagsSubscriptionWithContext(context.Background(), createTagsSubscriptionOptions) } @@ -1425,8 +1425,8 @@ func (eventNotifications *EventNotificationsV1) CreateTagsSubscriptionWithContex return } -// ListTagsSubscription : List all Tag Subscriptions -// List all Tag Subscriptions. +// ListTagsSubscription : List all tag subscriptions +// List all tag subscriptions. func (eventNotifications *EventNotificationsV1) ListTagsSubscription(listTagsSubscriptionOptions *ListTagsSubscriptionOptions) (result *TagsSubscriptionList, response *core.DetailedResponse, err error) { return eventNotifications.ListTagsSubscriptionWithContext(context.Background(), listTagsSubscriptionOptions) } @@ -1505,8 +1505,8 @@ func (eventNotifications *EventNotificationsV1) ListTagsSubscriptionWithContext( return } -// DeleteTagsSubscription : Delete a Tag subcription -// Delete a Tag subcription. +// DeleteTagsSubscription : Delete a tag subscription +// Delete a tag subscription. func (eventNotifications *EventNotificationsV1) DeleteTagsSubscription(deleteTagsSubscriptionOptions *DeleteTagsSubscriptionOptions) (response *core.DetailedResponse, err error) { return eventNotifications.DeleteTagsSubscriptionWithContext(context.Background(), deleteTagsSubscriptionOptions) } @@ -2933,6 +2933,15 @@ type DestinationConfigOneOf struct { // If pre prod enabled. PreProd *bool `json:"pre_prod,omitempty"` + // FCM project_id. + ProjectID *string `json:"project_id,omitempty"` + + // FCM private_key. + PrivateKey *string `json:"private_key,omitempty"` + + // FCM client_email. + ClientEmail *string `json:"client_email,omitempty"` + // Authentication type (p8 or p12). CertType *string `json:"cert_type,omitempty"` @@ -3031,6 +3040,18 @@ func UnmarshalDestinationConfigOneOf(m map[string]json.RawMessage, result interf if err != nil { return } + err = core.UnmarshalPrimitive(m, "project_id", &obj.ProjectID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "private_key", &obj.PrivateKey) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_email", &obj.ClientEmail) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "cert_type", &obj.CertType) if err != nil { return @@ -6722,27 +6743,26 @@ func UnmarshalDestinationConfigOneOfChromeDestinationConfig(m map[string]json.Ra return } -// DestinationConfigOneOfFcmDestinationConfig : Payload describing an FCM destination configuration. +// DestinationConfigOneOfFcmDestinationConfig : Payload describing an FCM destination configuration. project_id, private_key and client_email for FCM HTTP v1 APIs. // This model "extends" DestinationConfigOneOf type DestinationConfigOneOfFcmDestinationConfig struct { // FCM server_key. - ServerKey *string `json:"server_key" validate:"required"` + ServerKey *string `json:"server_key,omitempty"` // FCM sender_id. - SenderID *string `json:"sender_id" validate:"required"` + SenderID *string `json:"sender_id,omitempty"` // If pre prod enabled. PreProd *bool `json:"pre_prod,omitempty"` -} -// NewDestinationConfigOneOfFcmDestinationConfig : Instantiate DestinationConfigOneOfFcmDestinationConfig (Generic Model Constructor) -func (*EventNotificationsV1) NewDestinationConfigOneOfFcmDestinationConfig(serverKey string, senderID string) (_model *DestinationConfigOneOfFcmDestinationConfig, err error) { - _model = &DestinationConfigOneOfFcmDestinationConfig{ - ServerKey: core.StringPtr(serverKey), - SenderID: core.StringPtr(senderID), - } - err = core.ValidateStruct(_model, "required parameters") - return + // FCM project_id. + ProjectID *string `json:"project_id,omitempty"` + + // FCM private_key. + PrivateKey *string `json:"private_key,omitempty"` + + // FCM client_email. + ClientEmail *string `json:"client_email,omitempty"` } func (*DestinationConfigOneOfFcmDestinationConfig) isaDestinationConfigOneOf() bool { @@ -6764,6 +6784,18 @@ func UnmarshalDestinationConfigOneOfFcmDestinationConfig(m map[string]json.RawMe if err != nil { return } + err = core.UnmarshalPrimitive(m, "project_id", &obj.ProjectID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "private_key", &obj.PrivateKey) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "client_email", &obj.ClientEmail) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -8121,9 +8153,7 @@ func UnmarshalSubscriptionUpdateAttributesWebhookAttributes(m map[string]json.Ra return } -// // SourcesPager can be used to simplify the use of the "ListSources" method. -// type SourcesPager struct { hasNext bool options *ListSourcesOptions @@ -8208,9 +8238,7 @@ func (pager *SourcesPager) GetAll() (allItems []SourceListItem, err error) { return pager.GetAllWithContext(context.Background()) } -// // TopicsPager can be used to simplify the use of the "ListTopics" method. -// type TopicsPager struct { hasNext bool options *ListTopicsOptions @@ -8295,9 +8323,7 @@ func (pager *TopicsPager) GetAll() (allItems []TopicsListItem, err error) { return pager.GetAllWithContext(context.Background()) } -// // DestinationsPager can be used to simplify the use of the "ListDestinations" method. -// type DestinationsPager struct { hasNext bool options *ListDestinationsOptions @@ -8382,9 +8408,7 @@ func (pager *DestinationsPager) GetAll() (allItems []DestinationListItem, err er return pager.GetAllWithContext(context.Background()) } -// // TagsSubscriptionPager can be used to simplify the use of the "ListTagsSubscription" method. -// type TagsSubscriptionPager struct { hasNext bool options *ListTagsSubscriptionOptions @@ -8469,9 +8493,7 @@ func (pager *TagsSubscriptionPager) GetAll() (allItems []TagsSubscriptionListIte return pager.GetAllWithContext(context.Background()) } -// // SubscriptionsPager can be used to simplify the use of the "ListSubscriptions" method. -// type SubscriptionsPager struct { hasNext bool options *ListSubscriptionsOptions @@ -8556,9 +8578,7 @@ func (pager *SubscriptionsPager) GetAll() (allItems []SubscriptionListItem, err return pager.GetAllWithContext(context.Background()) } -// // IntegrationsPager can be used to simplify the use of the "ListIntegrations" method. -// type IntegrationsPager struct { hasNext bool options *ListIntegrationsOptions diff --git a/eventnotificationsv1/event_notifications_v1_examples_test.go b/eventnotificationsv1/event_notifications_v1_examples_test.go index c3413dc..5ef4d52 100644 --- a/eventnotificationsv1/event_notifications_v1_examples_test.go +++ b/eventnotificationsv1/event_notifications_v1_examples_test.go @@ -24,6 +24,7 @@ import ( "encoding/json" "fmt" "os" + "strings" "github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1" "github.com/IBM/go-sdk-core/v5/core" @@ -32,7 +33,6 @@ import ( . "github.com/onsi/gomega" ) -// // This file provides an example of how to use the Event Notifications service. // // The following configuration properties are assumed to be defined: @@ -44,7 +44,6 @@ import ( // These configuration properties can be exported as environment variables, or stored // in a configuration file and then: // export IBM_CREDENTIALS_FILE= -// const externalConfigFile = "../event_notifications_v1.env" var ( @@ -69,6 +68,7 @@ var ( destinationID9 string destinationID10 string destinationID11 string + destinationID12 string subscriptionID string subscriptionID1 string subscriptionID2 string @@ -82,6 +82,9 @@ var ( sNowUserName string sNowPassword string sNowInstanceName string + fcmPrivateKey string + fcmProjectID string + fcmClientEmail string ) func shouldSkipTest() { @@ -123,6 +126,25 @@ var _ = Describe(`EventNotificationsV1 Examples Tests`, func() { } fmt.Printf("Service fcmSenderId: %s\n", fcmSenderId) + fcmProjectID = config["FCM_PROJECT_ID"] + if fcmProjectID == "" { + Skip("Unable to load service fcmProjectID configuration property, skipping tests") + } + fmt.Printf("Service fcmProjectID: %s\n", fcmProjectID) + + fcmClientEmail = config["FCM_CLIENT_EMAIL"] + if fcmClientEmail == "" { + Skip("Unable to load service fcmclientEmail configuration property, skipping tests") + } + fmt.Printf("Service fcmClientEmail: %s\n", fcmClientEmail) + + fcmPrivateKey = config["FCM_PRIVATE_KEY"] + fcmPrivateKey = strings.ReplaceAll(fcmPrivateKey, "\\n", "\n") + if fcmPrivateKey == "" { + Skip("Unable to load service fcmPrivateKey configuration property, skipping tests") + } + fmt.Printf("Service fcmPrivateKey: %s\n", fcmPrivateKey) + safariCertificatePath = config["SAFARI_CERTIFICATE"] if safariCertificatePath == "" { Skip("Unable to load service safariCertificatePath configuration property, skipping tests") @@ -815,6 +837,38 @@ var _ = Describe(`EventNotificationsV1 Examples Tests`, func() { Expect(destinationResponse).ToNot(BeNil()) destinationID11 = *destinationResponse.ID + + createFCMV1DestinationOptions := eventNotificationsService.NewCreateDestinationOptions( + instanceID, + "FCM_destination_V1", + eventnotificationsv1.CreateDestinationOptionsTypePushAndroidConst, + ) + + destinationFCMV1ConfigParamsModel := &eventnotificationsv1.DestinationConfigOneOfFcmDestinationConfig{ + ProjectID: core.StringPtr(fcmProjectID), + PrivateKey: core.StringPtr(fcmPrivateKey), + ClientEmail: core.StringPtr(fcmClientEmail), + } + + destinationFCMV1ConfigModel := &eventnotificationsv1.DestinationConfig{ + Params: destinationFCMV1ConfigParamsModel, + } + + createDestinationOptions.SetConfig(destinationFCMV1ConfigModel) + + destinationResponse, response, err = eventNotificationsService.CreateDestination(createFCMV1DestinationOptions) + if err != nil { + panic(err) + } + + b, _ = json.MarshalIndent(destinationResponse, "", " ") + fmt.Println(string(b)) + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(201)) + Expect(destinationResponse).ToNot(BeNil()) + + destinationID12 = *destinationResponse.ID // end-create_destination }) @@ -1206,6 +1260,37 @@ var _ = Describe(`EventNotificationsV1 Examples Tests`, func() { b, _ = json.MarshalIndent(destination, "", " ") fmt.Println(string(b)) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(destination).ToNot(BeNil()) + + //FCM V1 + + destinationConfigFCMV1ParamsModel := &eventnotificationsv1.DestinationConfigOneOfFcmDestinationConfig{ + ProjectID: core.StringPtr(fcmProjectID), + PrivateKey: core.StringPtr(fcmPrivateKey), + ClientEmail: core.StringPtr(fcmClientEmail), + } + destinationConfigFCMV1Model := &eventnotificationsv1.DestinationConfig{ + Params: destinationConfigFCMV1ParamsModel, + } + + updateFCMV1DestinationOptions := eventNotificationsService.NewUpdateDestinationOptions( + instanceID, + destinationID12, + ) + + updateFCMV1DestinationOptions.SetName("Admin FCM V1 Compliance") + updateFCMV1DestinationOptions.SetDescription("This destination is for creating admin FCM V1 to receive compliance notifications") + updateFCMV1DestinationOptions.SetConfig(destinationConfigFCMV1Model) + + destination, response, err = eventNotificationsService.UpdateDestination(updateFCMV1DestinationOptions) + if err != nil { + panic(err) + } + b, _ = json.MarshalIndent(destination, "", " ") + fmt.Println(string(b)) + Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(destination).ToNot(BeNil()) @@ -1782,7 +1867,7 @@ var _ = Describe(`EventNotificationsV1 Examples Tests`, func() { Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) - for _, ID := range []string{destinationID3, destinationID4, destinationID5, destinationID6, destinationID7, destinationID8, destinationID9, destinationID10} { + for _, ID := range []string{destinationID3, destinationID4, destinationID5, destinationID6, destinationID7, destinationID8, destinationID9, destinationID10, destinationID11, destinationID12} { deleteDestinationOptions := &eventnotificationsv1.DeleteDestinationOptions{ InstanceID: core.StringPtr(instanceID), ID: core.StringPtr(ID), diff --git a/eventnotificationsv1/event_notifications_v1_integration_test.go b/eventnotificationsv1/event_notifications_v1_integration_test.go index 42d914a..b3ffb26 100644 --- a/eventnotificationsv1/event_notifications_v1_integration_test.go +++ b/eventnotificationsv1/event_notifications_v1_integration_test.go @@ -71,6 +71,7 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { destinationID9 string destinationID10 string destinationID11 string + destinationID12 string subscriptionID string subscriptionID1 string subscriptionID2 string @@ -83,6 +84,7 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { subscriptionID9 string subscriptionID10 string subscriptionID11 string + subscriptionID12 string fcmServerKey string fcmSenderId string integrationId string @@ -91,6 +93,9 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { sNowUserName string sNowPassword string sNowInstanceName string + fcmPrivateKey string + fcmProjectID string + fcmClientEmail string ) var shouldSkipTest = func() { @@ -134,6 +139,24 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { } fmt.Printf("Service fcmSenderId: %s\n", fcmSenderId) + fcmProjectID = config["FCM_PROJECT_ID"] + if fcmProjectID == "" { + Skip("Unable to load service fcmProjectID configuration property, skipping tests") + } + fmt.Printf("Service fcmProjectID: %s\n", fcmProjectID) + + fcmClientEmail = config["FCM_CLIENT_EMAIL"] + if fcmClientEmail == "" { + Skip("Unable to load service fcmclientEmail configuration property, skipping tests") + } + fmt.Printf("Service fcmClientEmail: %s\n", fcmClientEmail) + + fcmPrivateKey = config["FCM_PRIVATE_KEY"] + if fcmPrivateKey == "" { + Skip("Unable to load service fcmPrivateKey configuration property, skipping tests") + } + fmt.Printf("Service fcmPrivateKey: %s\n", fcmPrivateKey) + safariCertificatePath = config["SAFARI_CERTIFICATE"] if safariCertificatePath == "" { Skip("Unable to load service safariCertificatePath configuration property, skipping tests") @@ -898,6 +921,34 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { Expect(destinationResponse).ToNot(BeNil()) destinationID11 = *destinationResponse.ID + + createFCMDestinationOptions = eventNotificationsService.NewCreateDestinationOptions( + instanceID, + "FCM_destination_V1", + eventnotificationsv1.CreateDestinationOptionsTypePushAndroidConst, + ) + + destinationConfigParamsFCMModel = &eventnotificationsv1.DestinationConfigOneOfFcmDestinationConfig{ + ProjectID: core.StringPtr(fcmProjectID), + PrivateKey: core.StringPtr(fcmPrivateKey), + ClientEmail: core.StringPtr(fcmClientEmail), + } + + fcmDestinationConfigModel = &eventnotificationsv1.DestinationConfig{ + Params: destinationConfigParamsFCMModel, + } + + createFCMDestinationOptions.SetConfig(fcmDestinationConfigModel) + + destinationResponse, response, err = eventNotificationsService.CreateDestination(createFCMDestinationOptions) + if err != nil { + panic(err) + } + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(201)) + Expect(destinationResponse).ToNot(BeNil()) + + destinationID12 = *destinationResponse.ID // // The following status codes aren't covered by tests. // Please provide integration tests for these too. @@ -1317,6 +1368,34 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { Expect(destination.Name).To(Equal(core.StringPtr(serviceNowName))) Expect(destination.Description).To(Equal(core.StringPtr(serviceNowDescription))) + destinationConfigParamsFCMModel = &eventnotificationsv1.DestinationConfigOneOfFcmDestinationConfig{ + ProjectID: core.StringPtr(fcmProjectID), + PrivateKey: core.StringPtr(fcmPrivateKey), + ClientEmail: core.StringPtr(fcmClientEmail), + } + + fcmDestinationConfigModel = &eventnotificationsv1.DestinationConfig{ + Params: destinationConfigParamsFCMModel, + } + + fcmName = "fcm_V1_destination_update" + fcmDescription = "This destination is for FCM V1" + fcmUpdateDestinationOptions = &eventnotificationsv1.UpdateDestinationOptions{ + InstanceID: core.StringPtr(instanceID), + ID: core.StringPtr(destinationID12), + Name: core.StringPtr(fcmName), + Description: core.StringPtr(fcmDescription), + Config: fcmDestinationConfigModel, + } + + destination, response, err = eventNotificationsService.UpdateDestination(fcmUpdateDestinationOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(destination).ToNot(BeNil()) + Expect(destination.ID).To(Equal(core.StringPtr(destinationID12))) + Expect(destination.Name).To(Equal(core.StringPtr(fcmName))) + Expect(destination.Description).To(Equal(core.StringPtr(fcmDescription))) + // // The following status codes aren't covered by tests. // Please provide integration tests for these too. @@ -1572,6 +1651,23 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { Expect(response.StatusCode).To(Equal(201)) Expect(subscription).ToNot(BeNil()) subscriptionID11 = string(*subscription.ID) + + createFCMSubscriptionOptions = &eventnotificationsv1.CreateSubscriptionOptions{ + InstanceID: core.StringPtr(instanceID), + Name: core.StringPtr("FCM subscription V1"), + Description: core.StringPtr("Subscription for the FCM V1"), + DestinationID: core.StringPtr(destinationID12), + TopicID: core.StringPtr(topicID3), + } + + subscription, response, err = eventNotificationsService.CreateSubscription(createFCMSubscriptionOptions) + if err != nil { + panic(err) + } + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(201)) + Expect(subscription).ToNot(BeNil()) + subscriptionID12 = string(*subscription.ID) // // The following status codes aren't covered by tests. // Please provide integration tests for these too. @@ -1925,6 +2021,24 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { Expect(subscription.ID).To(Equal(core.StringPtr(subscriptionID11))) Expect(subscription.Name).To(Equal(serviceNowName)) Expect(subscription.Description).To(Equal(serviceNowDescription)) + + fcmName = core.StringPtr("subscription_FCM_V1_update") + fcmDescription = core.StringPtr("Subscription update for FCM V1") + updateFCMSubscriptionOptions = &eventnotificationsv1.UpdateSubscriptionOptions{ + InstanceID: core.StringPtr(instanceID), + Name: fcmName, + Description: fcmDescription, + ID: core.StringPtr(subscriptionID12), + } + + subscription, response, err = eventNotificationsService.UpdateSubscription(updateFCMSubscriptionOptions) + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(subscription).ToNot(BeNil()) + Expect(subscription.ID).To(Equal(core.StringPtr(subscriptionID12))) + Expect(subscription.Name).To(Equal(fcmName)) + Expect(subscription.Description).To(Equal(fcmDescription)) // // The following status codes aren't covered by tests. // Please provide integration tests for these too. @@ -1945,10 +2059,9 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { }) It(`SendNotifications(sendNotificationsOptions *SendNotificationsOptions)`, func() { - notificationDevicesModel := "{\"user_ids\": [\"userId\"]}" - - notificationFcmBodyModel := "{\"en_data\": {\"alert\": \"Alert message\"}}" - notificationAPNsBodyModel := "{\"en_data\": {\"alert\": \"Alert message\"}}" + notificationDevicesModel := "{\"platforms\":[\"push_ios\",\"push_android\",\"push_chrome\",\"push_firefox\"]}" + notificationFcmBodyModel := "{\"message\": {\"android\": {\"notification\": {\"title\": \"Breaking News\",\"body\": \"New news story available.\"},\"data\": {\"name\": \"Willie Greenholt\",\"description\": \"description\"}}}}" + notificationAPNsBodyModel := "{\"aps\":{\"alert\":{\"title\":\"Hello!! GameRequest\",\"body\":\"Bob wants to play poker\",\"action-loc-key\":\"PLAY\"},\"badge\":5}}" notificationSafariBodyModel := "{\"en_data\": {\"alert\": \"Alert message\"}}" notificationSeverity := "MEDIUM" @@ -2105,7 +2218,7 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { }) It(`DeleteSubscription(deleteSubscriptionOptions *DeleteSubscriptionOptions)`, func() { - for _, ID := range []string{subscriptionID, subscriptionID1, subscriptionID2, subscriptionID3, subscriptionID4, subscriptionID5, subscriptionID6, subscriptionID7, subscriptionID8, subscriptionID9, subscriptionID10, subscriptionID11} { + for _, ID := range []string{subscriptionID, subscriptionID1, subscriptionID2, subscriptionID3, subscriptionID4, subscriptionID5, subscriptionID6, subscriptionID7, subscriptionID8, subscriptionID9, subscriptionID10, subscriptionID11, subscriptionID12} { deleteSubscriptionOptions := &eventnotificationsv1.DeleteSubscriptionOptions{ InstanceID: core.StringPtr(instanceID), @@ -2163,7 +2276,7 @@ var _ = Describe(`EventNotificationsV1 Integration Tests`, func() { }) It(`DeleteDestination(deleteDestinationOptions *DeleteDestinationOptions)`, func() { - for _, ID := range []string{destinationID, destinationID3, destinationID4, destinationID5, destinationID6, destinationID7, destinationID8, destinationID9, destinationID10, destinationID11} { + for _, ID := range []string{destinationID, destinationID3, destinationID4, destinationID5, destinationID6, destinationID7, destinationID8, destinationID9, destinationID10, destinationID11, destinationID12} { deleteDestinationOptions := &eventnotificationsv1.DeleteDestinationOptions{ InstanceID: core.StringPtr(instanceID), ID: core.StringPtr(ID), diff --git a/eventnotificationsv1/event_notifications_v1_test.go b/eventnotificationsv1/event_notifications_v1_test.go index 711e5dc..f05b950 100644 --- a/eventnotificationsv1/event_notifications_v1_test.go +++ b/eventnotificationsv1/event_notifications_v1_test.go @@ -21,7 +21,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -67,14 +66,13 @@ var _ = Describe(`EventNotificationsV1`, func() { Context(`Using external config, construct service client instances`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "EVENT_NOTIFICATIONS_URL": "https://eventnotificationsv1/api", + "EVENT_NOTIFICATIONS_URL": "https://eventnotificationsv1/api", "EVENT_NOTIFICATIONS_AUTH_TYPE": "noauth", } It(`Create service client using external config successfully`, func() { SetTestEnvironment(testEnvironment) - eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1UsingExternalConfig(&eventnotificationsv1.EventNotificationsV1Options{ - }) + eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1UsingExternalConfig(&eventnotificationsv1.EventNotificationsV1Options{}) Expect(eventNotificationsService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) @@ -103,8 +101,7 @@ var _ = Describe(`EventNotificationsV1`, func() { }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) - eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1UsingExternalConfig(&eventnotificationsv1.EventNotificationsV1Options{ - }) + eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1UsingExternalConfig(&eventnotificationsv1.EventNotificationsV1Options{}) err := eventNotificationsService.SetServiceURL("https://testService/api") Expect(err).To(BeNil()) Expect(eventNotificationsService).ToNot(BeNil()) @@ -122,13 +119,12 @@ var _ = Describe(`EventNotificationsV1`, func() { Context(`Using external config, construct service client instances with error: Invalid Auth`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "EVENT_NOTIFICATIONS_URL": "https://eventnotificationsv1/api", + "EVENT_NOTIFICATIONS_URL": "https://eventnotificationsv1/api", "EVENT_NOTIFICATIONS_AUTH_TYPE": "someOtherAuth", } SetTestEnvironment(testEnvironment) - eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1UsingExternalConfig(&eventnotificationsv1.EventNotificationsV1Options{ - }) + eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1UsingExternalConfig(&eventnotificationsv1.EventNotificationsV1Options{}) It(`Instantiate service client with error`, func() { Expect(eventNotificationsService).To(BeNil()) @@ -139,7 +135,7 @@ var _ = Describe(`EventNotificationsV1`, func() { Context(`Using external config, construct service client instances with error: Invalid URL`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "EVENT_NOTIFICATIONS_AUTH_TYPE": "NOAuth", + "EVENT_NOTIFICATIONS_AUTH_TYPE": "NOAuth", } SetTestEnvironment(testEnvironment) @@ -1412,14 +1408,14 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=135") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) It(`Invoke GetNextOffset without a "Next" property in the response`, func() { responseObject := new(eventnotificationsv1.SourceList) - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -1429,7 +1425,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -1439,7 +1435,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=tiger") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).NotTo(BeNil()) Expect(value).To(BeNil()) @@ -1478,8 +1474,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listSourcesOptionsModel := &eventnotificationsv1.ListSourcesOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewSourcesPager(listSourcesOptionsModel) @@ -1505,8 +1501,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listSourcesOptionsModel := &eventnotificationsv1.ListSourcesOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewSourcesPager(listSourcesOptionsModel) @@ -2626,14 +2622,14 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=135") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) It(`Invoke GetNextOffset without a "Next" property in the response`, func() { responseObject := new(eventnotificationsv1.TopicList) - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -2643,7 +2639,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -2653,7 +2649,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=tiger") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).NotTo(BeNil()) Expect(value).To(BeNil()) @@ -2692,8 +2688,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listTopicsOptionsModel := &eventnotificationsv1.ListTopicsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewTopicsPager(listTopicsOptionsModel) @@ -2719,8 +2715,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listTopicsOptionsModel := &eventnotificationsv1.ListTopicsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewTopicsPager(listTopicsOptionsModel) @@ -3946,14 +3942,14 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=135") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) It(`Invoke GetNextOffset without a "Next" property in the response`, func() { responseObject := new(eventnotificationsv1.DestinationList) - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -3963,7 +3959,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -3973,7 +3969,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=tiger") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).NotTo(BeNil()) Expect(value).To(BeNil()) @@ -4012,8 +4008,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listDestinationsOptionsModel := &eventnotificationsv1.ListDestinationsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewDestinationsPager(listDestinationsOptionsModel) @@ -4039,8 +4035,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listDestinationsOptionsModel := &eventnotificationsv1.ListDestinationsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewDestinationsPager(listDestinationsOptionsModel) @@ -4505,7 +4501,7 @@ var _ = Describe(`EventNotificationsV1`, func() { }) It(`Invoke UpdateDestination with error: Param validation error`, func() { eventNotificationsService, serviceErr := eventnotificationsv1.NewEventNotificationsV1(&eventnotificationsv1.EventNotificationsV1Options{ - URL: testServer.URL, + URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) @@ -5243,14 +5239,14 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=135") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) It(`Invoke GetNextOffset without a "Next" property in the response`, func() { responseObject := new(eventnotificationsv1.TagsSubscriptionList) - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -5260,7 +5256,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -5270,7 +5266,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=tiger") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).NotTo(BeNil()) Expect(value).To(BeNil()) @@ -5309,12 +5305,12 @@ var _ = Describe(`EventNotificationsV1`, func() { listTagsSubscriptionOptionsModel := &eventnotificationsv1.ListTagsSubscriptionOptions{ InstanceID: core.StringPtr("testString"), - ID: core.StringPtr("testString"), - DeviceID: core.StringPtr("testString"), - UserID: core.StringPtr("testString"), - TagName: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + ID: core.StringPtr("testString"), + DeviceID: core.StringPtr("testString"), + UserID: core.StringPtr("testString"), + TagName: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewTagsSubscriptionPager(listTagsSubscriptionOptionsModel) @@ -5340,12 +5336,12 @@ var _ = Describe(`EventNotificationsV1`, func() { listTagsSubscriptionOptionsModel := &eventnotificationsv1.ListTagsSubscriptionOptions{ InstanceID: core.StringPtr("testString"), - ID: core.StringPtr("testString"), - DeviceID: core.StringPtr("testString"), - UserID: core.StringPtr("testString"), - TagName: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + ID: core.StringPtr("testString"), + DeviceID: core.StringPtr("testString"), + UserID: core.StringPtr("testString"), + TagName: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewTagsSubscriptionPager(listTagsSubscriptionOptionsModel) @@ -5965,14 +5961,14 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=135") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) It(`Invoke GetNextOffset without a "Next" property in the response`, func() { responseObject := new(eventnotificationsv1.SubscriptionList) - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -5982,7 +5978,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -5992,7 +5988,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=tiger") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).NotTo(BeNil()) Expect(value).To(BeNil()) @@ -6031,8 +6027,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listSubscriptionsOptionsModel := &eventnotificationsv1.ListSubscriptionsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewSubscriptionsPager(listSubscriptionsOptionsModel) @@ -6058,8 +6054,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listSubscriptionsOptionsModel := &eventnotificationsv1.ListSubscriptionsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewSubscriptionsPager(listSubscriptionsOptionsModel) @@ -6960,14 +6956,14 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=135") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) It(`Invoke GetNextOffset without a "Next" property in the response`, func() { responseObject := new(eventnotificationsv1.IntegrationList) - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -6977,7 +6973,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -6987,7 +6983,7 @@ var _ = Describe(`EventNotificationsV1`, func() { nextObject := new(eventnotificationsv1.PageHrefResponse) nextObject.Href = core.StringPtr("ibm.com?offset=tiger") responseObject.Next = nextObject - + value, err := responseObject.GetNextOffset() Expect(err).NotTo(BeNil()) Expect(value).To(BeNil()) @@ -7026,8 +7022,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listIntegrationsOptionsModel := &eventnotificationsv1.ListIntegrationsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewIntegrationsPager(listIntegrationsOptionsModel) @@ -7053,8 +7049,8 @@ var _ = Describe(`EventNotificationsV1`, func() { listIntegrationsOptionsModel := &eventnotificationsv1.ListIntegrationsOptions{ InstanceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Search: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Search: core.StringPtr("testString"), } pager, err := eventNotificationsService.NewIntegrationsPager(listIntegrationsOptionsModel) @@ -8372,13 +8368,6 @@ var _ = Describe(`EventNotificationsV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) - It(`Invoke NewDestinationConfigOneOfFcmDestinationConfig successfully`, func() { - serverKey := "testString" - senderID := "testString" - _model, err := eventNotificationsService.NewDestinationConfigOneOfFcmDestinationConfig(serverKey, senderID) - Expect(_model).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) It(`Invoke NewDestinationConfigOneOfFirefoxDestinationConfig successfully`, func() { websiteURL := "testString" _model, err := eventNotificationsService.NewDestinationConfigOneOfFirefoxDestinationConfig(websiteURL) @@ -8536,7 +8525,7 @@ func CreateMockUUID(mockData string) *strfmt.UUID { } func CreateMockReader(mockData string) io.ReadCloser { - return ioutil.NopCloser(bytes.NewReader([]byte(mockData))) + return io.NopCloser(bytes.NewReader([]byte(mockData))) } func CreateMockDate(mockData string) *strfmt.Date { diff --git a/go.mod b/go.mod index b26b123..362fab4 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,36 @@ module github.com/IBM/event-notifications-go-admin-sdk -go 1.16 +go 1.18 require ( - github.com/IBM/go-sdk-core/v5 v5.10.2 + github.com/IBM/go-sdk-core/v5 v5.13.0 github.com/go-openapi/strfmt v0.21.3 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.18.0 - github.com/stretchr/testify v1.8.0 + github.com/onsi/gomega v1.27.2 + github.com/stretchr/testify v1.8.2 +) + +require ( + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-openapi/errors v0.20.3 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.11.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/nxadm/tail v1.4.8 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.mongodb.org/mongo-driver v1.11.2 // indirect + golang.org/x/crypto v0.5.0 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 050989f..f5eb375 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,30 @@ -github.com/IBM/go-sdk-core/v5 v5.10.2 h1:bfqhYNwwpJ3zJQSYpF3umhmRIKaa762itvJkTAWCCLU= -github.com/IBM/go-sdk-core/v5 v5.10.2/go.mod h1:WZPFasUzsKab/2mzt29xPcfruSk5js2ywAPwW4VJjdI= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/IBM/go-sdk-core/v5 v5.13.0 h1:foXLa2LfTSr3kgldpizaSDXH3gS/HB3YKj1BK8ywrE4= +github.com/IBM/go-sdk-core/v5 v5.13.0/go.mod h1:pVkN7IGmsSdmR1ZCU4E/cLcCclqRKMYgg7ya+O2Mk6g= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= +github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -28,40 +33,37 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -70,27 +72,27 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.8.4 h1:gf5mIQ8cLFieruNLAdgijHF1PYfLphKm2dxxcUtcqK0= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.0 h1:ngbYoRctxjl8SiF7XgP0NxBFbfHcg3wfHMMaFHWwMTM= -github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.27.2 h1:SKU0CXeKE/WVgIV1T61kSa3+IRE8Ekrv9rdXDwwTqnY= +github.com/onsi/gomega v1.27.2/go.mod h1:5mR3phAHpkAVIDkHEUBY6HGVsU+cpcEscrGPB4oPlZI= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -98,21 +100,24 @@ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23n github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.mongodb.org/mongo-driver v1.10.0 h1:UtV6N5k14upNp4LTduX0QCufG124fSu25Wz9tu94GLg= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.mongodb.org/mongo-driver v1.11.2 h1:+1v2rDQUWNcGW7/7E0Jvdz51V38XXxJfhzbV17aNHCw= +go.mongodb.org/mongo-driver v1.11.2/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -123,24 +128,26 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -151,25 +158,17 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= -gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=