func (mgsService *MessageGatewayService) CreateDataChannel(log log.T, createDataChannelInput *CreateDataChannelInput, sessionId string) (createDataChannelOutput *CreateDataChannelOutput, err error) {

	url, err := getMGSBaseUrl(log, mgsconfig.DataChannel, sessionId, mgsService.region)
	if err != nil {
		return nil, fmt.Errorf("failed to get the mgs base url with error: %s", err)
	}

	if mgsService.signer == nil {
		return nil, errors.New("MGS service signer is nil")
	}

	jsonValue, err := json.Marshal(createDataChannelInput)
	if err != nil {
		return nil, errors.New("unable to marshal the createDataChannelInput")
	}

	resp, err := makeRestcall(jsonValue, "POST", url, mgsService.region, mgsService.signer)
	if err != nil {
		return nil, fmt.Errorf("createDataChannel request failed: %s", err)
	}

	var output CreateDataChannelOutput
	if resp != nil {
		if err = xml.Unmarshal(resp, &output); err != nil {
			return nil, fmt.Errorf("failed to unmarshal createDataChannel response: %s", err)
		}
		return &output, err
	}

	return nil, err
}
// CreateDataChannel calls the CreateDataChannel MGS API
CreateDataChannel calls the CreateDataChannel MGS API
// CreateDataChannel calls the CreateDataChannel MGS API
func (mgsService *MessageGatewayService) CreateDataChannel(log log.T, createDataChannelInput *CreateDataChannelInput, sessionId string) (createDataChannelOutput *CreateDataChannelOutput, err error) {
	url, err := getMGSBaseUrl(log, mgsconfig.DataChannel, sessionId, mgsService.region)
	if err != nil {
		return nil, fmt.Errorf("failed to get the mgs base url with error: %s", err)
	}
	if mgsService.signer == nil {
		return nil, errors.New("MGS service signer is nil")
	}
	jsonValue, err := json.Marshal(createDataChannelInput)
	if err != nil {
		return nil, errors.New("unable to marshal the createDataChannelInput")
	}
	resp, err := makeRestcall(jsonValue, "POST", url, mgsService.region, mgsService.signer)
	if err != nil {
		return nil, fmt.Errorf("createDataChannel request failed: %s", err)
	}
	var output CreateDataChannelOutput
	if resp != nil {
		if err = xml.Unmarshal(resp, &output); err != nil {
			return nil, fmt.Errorf("failed to unmarshal createDataChannel response: %s", err)
		}
		return &output, err
	}
	return nil, err
}
func ( mgsService * MessageGatewayService ) CreateDataChannel ( log log . T , createDataChannelInput * CreateDataChannelInput , sessionId string ) ( createDataChannelOutput * CreateDataChannelOutput , err error ) { url , err := getMGSBaseUrl ( log , mgsconfig . DataChannel , sessionId , mgsService . region ) if err != nil { return nil , fmt . Errorf ( " " , err ) } if mgsService . signer == nil { return nil , errors . New ( " " ) } jsonValue , err := json . Marshal ( createDataChannelInput ) if err != nil { return nil , errors . New ( " " ) } resp , err := makeRestcall ( jsonValue , " " , url , mgsService . region , mgsService . signer ) if err != nil { return nil , fmt . Errorf ( " " , err ) } var output CreateDataChannelOutput if resp != nil { if err = xml . Unmarshal ( resp , & output ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } return & output , err } return nil , err }
CreateDataChannel calls the CreateDataChannel MGS API
CreateDataChannel calls the CreateDataChannel MGS API