import { toQueryString } from "../../utils" ; import { SdkClient } from "../common/sdk-client" ; import { notificationTemplate } from "./notification-data-template" ; import { NotificationModelsV4 } from "./notification-v4-models" ; export class extends SdkClient export class NotificationClientV4 extends SdkClient { private _baseUrl : string = "/api/notification/v4" ; param { NotificationModelsV4 . MulticastEmailNotificationRequestMetadata } metadata param { NotificationModelsV4 . Attachment [ ] } attachments returns { Promise < NotificationModelsV4 . EmailJobResponse > } memberOf public async PostMulticastEmailNotificationJob ( metadata , attachments ? ) { if ( metadata === null || metadata === undefined ) { throw new NotificationModelsV4 . RequiredError ( "metadata" , "Required parameter metadata was null or undefined when calling PostMulticastEmailNotificationJobs." ) ; } const body = notificationTemplate ( metadata , attachments ) ; const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastEmailNotificationJobs` , body : body , multiPartFormData : true , additionalHeaders : { enctype : "multipart/form-data" } , } ) ; return result as NotificationModelsV4 . EmailJobResponse ; } param { string } id returns { Promise < NotificationModelsV4 . MulticastEmailNotificationJob > } memberOf public async GetMulticastEmailNotificationJob ( id ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastEmailNotificationJobs/${ id }` , } ) ; return result as NotificationModelsV4 . MulticastEmailNotificationJob ; } param { string } id param { { page ? : number ; size ? : number } } params returns { Promise < NotificationModelsV4 . NotificationDispatchStatus > } memberOf public async GetMulticastEmailNotificationJobsDeliveries ( id , params ? ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastEmailNotificationJobs/${ id }/deliveries?${ toQueryString ( parameters ) }` , } ) ; return result as NotificationModelsV4 . NotificationDispatchStatus ; } param { NotificationModelsV4 . MulticastSMSNotificationJobRequest } metadata returns { Promise < NotificationModelsV4 . SMSJobResponse > } memberOf public async PostMulticastSMSNotificationJob ( metadata ) { if ( metadata === null || metadata === undefined ) { throw new NotificationModelsV4 . RequiredError ( "metadata" , "Required parameter metadata was null or undefined when calling PostMulticastSMSNotificationJobs." ) ; } const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastSMSNotificationJobs` , body : metadata , } ) ; return result as NotificationModelsV4 . SMSJobResponse ; } param { string } id returns { Promise < NotificationModelsV4 . MulticastSMSNotificationJob > } memberOf public async GetMulticastSMSNotificationJob ( id ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastSMSNotificationJobs/${ id }` , } ) ; return result as NotificationModelsV4 . MulticastSMSNotificationJob ; } param { string } id param { { page ? : number ; size ? : number } } params returns { Promise < NotificationModelsV4 . NotificationDispatchStatusSMS > } memberOf public async GetMulticastSMSNotificationJobsDeliveries ( id , params ? ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastSMSNotificationJobs/${ id }/deliveries?${ toQueryString ( parameters ) }` , } ) ; return result as NotificationModelsV4 . NotificationDispatchStatusSMS ; } param { NotificationModelsV4 . MulticastPushNotificationJobsRequest } job returns { Promise < NotificationModelsV4 . SMSJobResponse > } memberOf public async PostMulticastPushNotificationJob ( job ) { if ( job === null || job === undefined ) { throw new NotificationModelsV4 . RequiredError ( "job" , "Required parameter job was null or undefined when calling PostMulticastSMSNotificationJobs." ) ; } const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastPushNotificationJobs` , body : job , } ) ; return result as NotificationModelsV4 . SendResponse ; } param { string } id returns { Promise < NotificationModelsV4 . SendResponse > } memberOf public async GetMulticastPushNotificationJob ( id ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/multicastPushNotificationJobs/${ id }` , } ) ; return result as NotificationModelsV4 . SendResponse ; } param { NotificationModelsV4 . AppRegistrationRequest } appData returns { Promise < NotificationModelsV4 . AppRegistrationResponse > } memberOf public async PostMobileApp ( appData ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : appData , baseUrl : `${ this . _baseUrl }/mobileApps` , } ) ; return result as NotificationModelsV4 . AppRegistrationRequest ; } param { { page ? : number ; size ? : number ; * } } params returns { Promise < NotificationModelsV4 . PagedAppRegistrationResponse > } memberOf public async GetMobileApps ( params ? ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/mobileApps?${ toQueryString ( parameters ) }` , } ) ; return result as NotificationModelsV4 . PagedAppRegistrationResponse ; } param { string } id param { NotificationModelsV4 . AppRegistrationUpdateRequest } appData returns { Promise < NotificationModelsV4 . AppRegistrationResponse > } memberOf public async PatchMobileApp ( id , appData ) { const result = await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : appData , baseUrl : `${ this . _baseUrl }/mobileApps/${ id }` , } ) ; return result as NotificationModelsV4 . AppRegistrationResponse ; } param { string } id memberOf public async DeleteMobileApp ( id ) { await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/mobileApps/${ id }` , noResponse : true , } ) ; } param { string } id param { NotificationModelsV4 . AppInstanceRequest } appInstanceData returns { Promise < NotificationModelsV4 . AppInstanceResponse > } memberOf public async PostMobileAppInstance ( id , appInstanceData ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : appInstanceData , baseUrl : `${ this . _baseUrl }/mobileApps/${ id }/instances` , } ) ; return result as NotificationModelsV4 . AppInstanceResponse ; } param { string } id param { { page ? : number ; size ? : number ; * } } params returns { Promise < NotificationModelsV4 . PagedAppInstanceResponse > } memberOf public async GetMobileAppsInstances ( id , params ? ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/mobileApps/${ id }/instances?${ toQueryString ( parameters ) }` , } ) ; return result as NotificationModelsV4 . PagedAppInstanceResponse ; } param { string } id param { string } instanceid param { NotificationModelsV4 . AppInstancePatchRequest } mobileAppInstanceData returns { Promise < NotificationModelsV4 . AppInstanceResponse > } memberOf public async PatchMobileAppInstance ( id , instanceid , mobileAppInstanceData ) { const result = await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : mobileAppInstanceData , baseUrl : `${ this . _baseUrl }/mobileApps/${ id }/instances/${ instanceid }` , } ) ; return result as NotificationModelsV4 . AppInstanceResponse ; } param { string } id param { string } instanceid memberOf public async DeleteMobileAppsInstance ( id , instanceid ) { await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/mobileApps/${ id }/instances/${ instanceid }` , noResponse : true , } ) ; } }