@@ -28,13 +28,13 @@ import (
2828 "github.com/mongodb/mongodbatlas-cloudformation-resources/util/constants"
2929)
3030
31- func isCallback (req * handler.Request ) bool {
31+ func IsCallback (req * handler.Request ) bool {
3232 _ , found := req .CallbackContext ["callbackStreamProcessor" ]
3333 return found
3434}
3535
3636func HandleCreate (req * handler.Request , client * util.MongoDBClient , model * Model ) handler.ProgressEvent {
37- if isCallback (req ) {
37+ if IsCallback (req ) {
3838 callbackCtx := getCallbackData (* req )
3939 if peErr := validateCallbackData (callbackCtx ); peErr != nil {
4040 return * peErr
@@ -107,7 +107,7 @@ func HandleCreate(req *handler.Request, client *util.MongoDBClient, model *Model
107107
108108 return handler.ProgressEvent {
109109 OperationStatus : handler .InProgress ,
110- Message : "Creating stream processor" ,
110+ Message : constants . Pending ,
111111 ResourceModel : inProgressModel ,
112112 CallbackDelaySeconds : defaultCallbackDelaySeconds ,
113113 CallbackContext : buildCallbackContext (projectID , workspaceOrInstanceName , processorName , map [string ]any {
@@ -160,13 +160,13 @@ func HandleRead(req *handler.Request, client *util.MongoDBClient, model *Model)
160160
161161 return handler.ProgressEvent {
162162 OperationStatus : handler .Success ,
163- Message : "Read Completed" ,
163+ Message : constants . ReadComplete ,
164164 ResourceModel : resourceModel ,
165165 }
166166}
167167
168168func HandleUpdate (req * handler.Request , client * util.MongoDBClient , prevModel * Model , model * Model ) handler.ProgressEvent {
169- if isCallback (req ) {
169+ if IsCallback (req ) {
170170 callbackCtx := getCallbackData (* req )
171171 if peErr := validateCallbackData (callbackCtx ); peErr != nil {
172172 return * peErr
@@ -249,7 +249,7 @@ func HandleUpdate(req *handler.Request, client *util.MongoDBClient, prevModel *M
249249
250250 return handler.ProgressEvent {
251251 OperationStatus : handler .InProgress ,
252- Message : "Stopping stream processor" ,
252+ Message : constants . Pending ,
253253 ResourceModel : inProgressModel ,
254254 CallbackDelaySeconds : defaultCallbackDelaySeconds ,
255255 CallbackContext : buildCallbackContext (projectID , workspaceOrInstanceName , processorName , map [string ]any {
@@ -295,7 +295,7 @@ func HandleUpdate(req *handler.Request, client *util.MongoDBClient, prevModel *M
295295
296296 return handler.ProgressEvent {
297297 OperationStatus : handler .InProgress ,
298- Message : "Starting stream processor" ,
298+ Message : constants . Pending ,
299299 ResourceModel : inProgressModel ,
300300 CallbackDelaySeconds : defaultCallbackDelaySeconds ,
301301 CallbackContext : buildCallbackContext (projectID , workspaceOrInstanceName , processorName , map [string ]any {
@@ -304,7 +304,7 @@ func HandleUpdate(req *handler.Request, client *util.MongoDBClient, prevModel *M
304304 }
305305 }
306306
307- return finalizeModel (streamProcessorResp , model , "Update Completed" )
307+ return finalizeModel (streamProcessorResp , model , constants . Complete )
308308}
309309
310310func HandleDelete (req * handler.Request , client * util.MongoDBClient , model * Model ) handler.ProgressEvent {
@@ -337,7 +337,7 @@ func HandleDelete(req *handler.Request, client *util.MongoDBClient, model *Model
337337
338338 return handler.ProgressEvent {
339339 OperationStatus : handler .Success ,
340- Message : "Delete Completed" ,
340+ Message : constants . Complete ,
341341 }
342342}
343343
@@ -374,7 +374,7 @@ func HandleList(req *handler.Request, client *util.MongoDBClient, model *Model)
374374
375375 return handler.ProgressEvent {
376376 OperationStatus : handler .Success ,
377- Message : "List Completed" ,
377+ Message : constants . Complete ,
378378 ResourceModels : response ,
379379 }
380380}
0 commit comments