<?php

return [

    'baseUrl' => isset($baseUrl) && !empty($baseUrl) ? $baseUrl : 'https://localhost',

    'options' => [
        'headers' => [

            'Connection' => 'close',

            'Accept'     => 'application/json',

            'User-Agent' => 'AUD-REST-CONNECTOR/1.0',

            'Authorization' => sprintf("%s %s",
                isset($authType) ? $authType : 'Basic',
                isset($token) && !empty($token) ? $token : 'none'
            )
        ]
    ],

    'routes' => [
        'account' => [

            // Authenticate an account
            'authenticate' => [
                'path' => '/api/account/v1/authenticate',
                'method' => 'POST',
                'verify' => true
            ],

            'create_organizational' => [
                'path' => '/api/account/organizational/v1',
                'method' => 'POST',
                'verify' => true
            ],

            // Create an account
            'create' => [
                'path' => '/api/account/v1',
                'method' => 'POST',
                'verify' => true
            ],

            // Read account info / attributes
            'read' => [
                'path' => '/api/account/v1/%s',
                'method' => 'GET',
                'verify' => true
            ],

            // Update account attributes
            'update' => [
                'path' => '/api/account/v1/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            // Update custom attributes
            'update_custom_attr' => [
                'path' => '/api/account/v1/%s/attributes',
                'method' => 'PUT',
                'verify' => true
            ],

            // Delete an account
            'delete' => [
                'path' => '/api/account/v1/%s',
                'method' => 'DELETE',
                'verify' => true
            ],

            // Add to group
            'add_to_group' => [
                'path' => '/api/account/v1/%s/group/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            // Add to multiple groups
            'add_to_multiple_groups' => [
                'path' => '/api/account/v1/%s/groups',
                'method' => 'PUT',
                'verify' => true
            ],

            // Remove from group
            'remove_from_group' => [
                'path' => '/api/account/v1/%s/group/%s',
                'method' => 'DELETE',
                'verify' => true
            ],

            // Activate the account, allowing authentication
            'activate' => [
                'path' => '/api/account/v1/%s/activate',
                'method' => 'PUT',
                'verify' => true
            ],

            // Deactivate account (no authentication allowed)
            'deactivate' => [
                'path' => '/api/account/v1/%s/deactivate',
                'method' => 'PUT',
                'verify' => true
            ],

            // Suspend account (no authentication allowed)
            'suspend' => [
                'path' => '/api/account/v1/%s/suspend',
                'method' => 'PUT',
                'verify' => true
            ],

            // List / search accounts
            'listing' => [
                'path' => '/api/account/v1',
                'method' => 'GET',
                'verify' => true
            ],

            // Set manager
            'setmanager' => [
                'path' => '/api/account/v1/%s/manager',
                'method' => 'PUT',
                'verify' => true
            ],

            // Unset manager
            'unsetmanager' => [
                'path' => '/api/account/v1/%s/manager',
                'method' => 'DELETE',
                'verify' => true
            ],

            // Change expiry date
            'expiry' => [
                'path' => '/api/account/v1/%s/expiry',
                'method' => 'PUT',
                'verify' => true
            ],

            'add_to_org' => [
                'path' => '/api/account/v1/%s/organization/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            'remove_from_org' => [
                'path' => '/api/account/v1/%s/organization',
                'method' => 'DELETE',
                'verify' => true
            ],

            'change_username' => [
                'path' => '/api/account/v1/%s/username',
                'method' => 'PUT',
                'verify' => true
            ],

            'change_password' => [
                'path' => '/api/account/v1/%s/password',
                'method' => 'PUT',
                'verify' => true
            ],

            'change_ppolicy' => [
                'path' => '/api/account/v1/%s/ppolicy/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            'logs' => [
                'path' => '/api/account/v1/%s/logs',
                'method' => 'GET',
                'verify' => true
            ]
        ],

        'organization' => [
            'create' => [
                'path' => '/api/organization/v1',
                'method' => 'POST',
                'verify' => true
            ],

            'create_for_account' => [
                'path' => '/api/organization/v1/for_account',
                'method' => 'POST',
                'verify' => true
            ],

            'read' => [
                'path' => '/api/organization/v1/%s',
                'method' => 'GET',
                'verify' => true
            ],

            'update' => [
                'path' => '/api/organization/v1/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            'delete' => [
                'path' => '/api/organization/v1/%s',
                'method' => 'DELETE',
                'verify' => true
            ],

            'listing' => [
                'path' => '/api/organization/v1',
                'method' => 'GET',
                'verify' => true
            ],

            'deactivate' => [
                'path' => '/api/organization/v1/%s/deactivate',
                'method' => 'POST',
                'verify' => true
            ],

            'members' => [
                'path' => '/api/organization/v1/%s/members',
                'method' => 'GET',
                'verify' => true
            ],

            'groups' => [
                'path' => '/api/organization/v1/%s/groups',
                'method' => 'GET',
                'verify' => true
            ],

            'children' => [
                'path' => '/api/organization/v1/%s/children',
                'method' => 'GET',
                'verify' => true
            ]
        ],

        'group' => [
            'create' => [
                'path' => '/api/group/v1',
                'method' => 'POST',
                'verify' => true
            ],

            'read' => [
                'path' => '/api/group/v1/%s',
                'method' => 'GET',
                'verify' => true
            ],

            'update' => [
                'path' => '/api/group/v1/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            'change_parent' => [
                'path' => '/api/group/v1/%s/parent',
                'method' => 'PUT',
                'verify' => true
            ],

            'delete' => [
                'path' => '/api/group/v1/%s',
                'method' => 'DELETE',
                'verify' => true
            ],

            'listing' => [
                'path' => '/api/group/v1',
                'method' => 'GET',
                'verify' => true
            ],

            'get_members' => [
                'path' => '/api/group/v1/%s/members',
                'method' => 'GET',
                'verify' => true
            ]
        ],

        'policy' => [
            'create' => [
                'path' => '/api/policy/v1',
                'method' => 'POST',
                'verify' => true
            ],

            'read' => [
                'path' => '/api/policy/v1/%s',
                'method' => 'GET',
                'verify' => true
            ],

            'update' => [
                'path' => '/api/policy/v1/%s',
                'method' => 'PUT',
                'verify' => true
            ],

            'delete' => [
                'path' => '/api/policy/v1/%s',
                'method' => 'DELETE',
                'verify' => true
            ],

            'listing' => [
                'path' => '/api/policy/v1',
                'method' => 'GET',
                'verify' => true
            ],
        ]
    ]
];