cwmiller / broadworks-connector

Simple library for connecting to BroadWorks OCI-P API
MIT License
8 stars 5 forks source link

GroupOutgoingCallingPlanRedirectingModifyListRequest #8

Closed TwinMist closed 5 years ago

TwinMist commented 6 years ago

Hi Do you have a example how you would change the GroupOutgoingCallingPlanRedirecting. for a department

thanks

<serviceProviderId>xxxxx</serviceProviderId>
<groupId>xxxxx</groupId>
<departmentPermissions>
  <departmentKey xsi:type="GroupDepartmentKey">
    <serviceProviderId>xxxxxL</serviceProviderId>
    <groupId>xxxxx</groupId>
    <name>Sales</name>
  </departmentKey>
  <permissions>
    <group>true</group>
    <local>false</local>
    <tollFree>false</tollFree>
    <toll>false</toll>
    <international>false</international>
    <operatorAssisted>true</operatorAssisted>
    <chargeableDirectoryAssisted>false</chargeableDirectoryAssisted>
    <specialServicesI>true</specialServicesI>
    <specialServicesII>false</specialServicesII>
    <premiumServicesI>false</premiumServicesI>
    <premiumServicesII>false</premiumServicesII>
    <casual>false</casual>
    <urlDialing>true</urlDialing>
    <unknown>true</unknown>
  </permissions>
</departmentPermissions>
cwmiller commented 5 years ago

I did a test of GroupOutgoingCallingPlanRedirectingModifyListRequest and received an error response from the server. It looks like there's an issue with the handling of abstract classes, in this case the DepartmentKey class. I'm working on a fix.

TwinMist commented 5 years ago

thanks for the fix, can you include a example how this should be coded? cheers

cwmiller commented 5 years ago

What I was using to test:

$departmentKey = (new GroupDepartmentKey())
    ->setServiceProviderId('Service Provider ID')
    ->setGroupId('Group ID')
    ->setName('Department Name');

$permissions = (new OutgoingCallingPlanRedirectingPermissionsModify())
    ->setGroup(true)
    ->setLocal(true)
    ->setTollFree(true)
    ->setToll(true)
    ->setInternational(false)
    ->setOperatorAssisted(false)
    ->setChargeableDirectoryAssisted(false)
    ->setSpecialServicesI(false)
    ->setSpecialServicesII(false)
    ->setPremiumServicesI(false)
    ->setPremiumServicesII(false)
    ->setCasual(false)
    ->setUrlDialing(false)
    ->setUnknown(false);

$departmentPermissions = (new OutgoingCallingPlanRedirectingDepartmentPermissionsModify())
    ->setDepartmentKey($departmentKey)
    ->setPermissions($permissions);

$request = (new GroupOutgoingCallingPlanRedirectingModifyListRequest())
    ->setServiceProviderId('Service Provider ID')
    ->setGroupId('Group ID')
    ->addDepartmentPermissions($departmentPermissions);

$response = $ocip->groupOutgoingCallingPlanRedirectingModifyListRequest($request);
TwinMist commented 5 years ago

Hi, how would you include the groupPermissions into the same request thanks

cwmiller commented 5 years ago

$permissions = (new OutgoingCallingPlanRedirectingPermissionsModify())
    ->setGroup(true)
    ->setLocal(true)
    ->setTollFree(true)
    ->setToll(true)
    ->setInternational(false)
    ->setOperatorAssisted(false)
    ->setChargeableDirectoryAssisted(false)
    ->setSpecialServicesI(false)
    ->setSpecialServicesII(false)
    ->setPremiumServicesI(false)
    ->setPremiumServicesII(false)
    ->setCasual(false)
    ->setUrlDialing(false)
    ->setUnknown(false);

$request = (new GroupOutgoingCallingPlanRedirectingModifyListRequest())
    ->setServiceProviderId('Service Provider ID')
    ->setGroupId('Group ID')
    ->setGroupPermissions($permissions);

$response = $ocip->groupOutgoingCallingPlanRedirectingModifyListRequest($request);