cwmiller / broadworks-connector

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

ServiceProviderServiceModifyAuthorizationListRequest #17

Closed TwinMist closed 6 years ago

TwinMist commented 6 years ago

Hi Are you able to create me an example for a ServiceProviderServiceModifyAuthorizationListRequest what do you do if you want to authorize multiple services within the same request?

Thanks

TwinMist commented 6 years ago

Hi. Can u help me with a example?

Many thanks. Great work.

cwmiller commented 6 years ago

Here's an example of authorizing group services Call Park & Music On Hold along with user services Busy Lamp Field and Do Not Disturb for service provider SP111

$req = (new ServiceProviderServiceModifyAuthorizationListRequest())
    ->setServiceProviderId('SP111')
    ->setGroupServiceAuthorization([
        (new GroupServiceAuthorization())
            ->setServiceName('Call Park')
            ->setAuthorizedQuantity(
                (new UnboundedPositiveInt())
                    ->setUnlimited(true)),
        (new GroupServiceAuthorization())
            ->setServiceName('Music On Hold')
            ->setAuthorizedQuantity(
                (new UnboundedPositiveInt())
                    ->setUnlimited(true)),
    ])
    ->setUserServiceAuthorization([
        (new UserServiceAuthorization())
            ->setServiceName('Busy Lamp Field')
            ->setAuthorizedQuantity(
                (new UnboundedPositiveInt())
                    ->setUnlimited(true)),
        (new UserServiceAuthorization())
            ->setServiceName('Do Not Disturb')
            ->setAuthorizedQuantity(
                (new UnboundedPositiveInt())
                    ->setUnlimited(true)),
    ]);

$ocip->serviceProviderServiceModifyAuthorizationListRequest($req)