Exemplo n.º 1
0
        public static Environment CreateEnvironmentResponse()
        {
            InfrastructureService environmentURL = new InfrastructureService {
                Name = InfrastructureServiceNames.environment, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/environments/5b72f2d4-7a83-4297-a71f-8b5fb26cbf14"
            };
            InfrastructureService provisionRequestsURL = new InfrastructureService {
                Name = InfrastructureServiceNames.provisionRequests, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/provisionRequests"
            };
            InfrastructureService queuesURL = new InfrastructureService {
                Name = InfrastructureServiceNames.queues, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/queues"
            };
            InfrastructureService requestsConnectorURL = new InfrastructureService {
                Name = InfrastructureServiceNames.requestsConnector, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/requestsConnector"
            };
            InfrastructureService subscriptionsURL = new InfrastructureService {
                Name = InfrastructureServiceNames.subscriptions, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/subscriptions"
            };
            IDictionary <InfrastructureServiceNames, InfrastructureService> infrastructureServices = new Dictionary <InfrastructureServiceNames, InfrastructureService>
            {
                { environmentURL.Name, environmentURL },
                { provisionRequestsURL.Name, provisionRequestsURL },
                { queuesURL.Name, queuesURL },
                { requestsConnectorURL.Name, requestsConnectorURL },
                { subscriptionsURL.Name, subscriptionsURL }
            };

            Right adminRight = new Right {
                Type = "ADMIN", Value = "APPROVED"
            };
            Right createRight = new Right {
                Type = "CREATE", Value = "APPROVED"
            };
            IDictionary <string, Right> rights = new Dictionary <string, Right> {
                { adminRight.Type, adminRight }
            };

            Infrastructure.Service studentPersonalsService = new Infrastructure.Service
            {
                ContextId = "DEFAULT",
                Name      = "StudentPersonals",
                Rights    = rights,
                Type      = "OBJECT"
            };
            Infrastructure.Service schoolInfosService = new Infrastructure.Service
            {
                ContextId = "DEFAULT",
                Name      = "SchoolInfos",
                Rights    = rights,
                Type      = "OBJECT"
            };
            ICollection <Infrastructure.Service> services = new SortedSet <Infrastructure.Service>
            {
                studentPersonalsService, schoolInfosService
            };

            ProvisionedZone schoolZone = new ProvisionedZone {
                SifId = "auSchoolTestingZone", Services = services
            };
            ProvisionedZone studentZone = new ProvisionedZone {
                SifId = "auStudentTestingZone", Services = services
            };

            IDictionary <string, ProvisionedZone> provisionedZones = new SortedDictionary <string, ProvisionedZone> {
                { schoolZone.SifId, schoolZone }, { studentZone.SifId, studentZone }
            };

            Environment environmentResponse = CreateEnvironmentRequest();

            environmentResponse.InfrastructureServices = infrastructureServices;
            environmentResponse.ProvisionedZones       = provisionedZones;

            return(environmentResponse);
        }
Exemplo n.º 2
0
        public static Environment CreateEnvironmentResponse()
        {
            InfrastructureService environmentURL = new InfrastructureService { Name = InfrastructureServiceNames.environment, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/environments/5b72f2d4-7a83-4297-a71f-8b5fb26cbf14" };
            InfrastructureService provisionRequestsURL = new InfrastructureService { Name = InfrastructureServiceNames.provisionRequests, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/provisionRequests" };
            InfrastructureService queuesURL = new InfrastructureService { Name = InfrastructureServiceNames.queues, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/queues" };
            InfrastructureService requestsConnectorURL = new InfrastructureService { Name = InfrastructureServiceNames.requestsConnector, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/requestsConnector" };
            InfrastructureService subscriptionsURL = new InfrastructureService { Name = InfrastructureServiceNames.subscriptions, Value = "http://rest3api.sifassociation.org/api/solutions/auTestSolution/subscriptions" };
            IDictionary<InfrastructureServiceNames, InfrastructureService> infrastructureServices = new Dictionary<InfrastructureServiceNames, InfrastructureService>
            {
                { environmentURL.Name, environmentURL },
                { provisionRequestsURL.Name, provisionRequestsURL },
                { queuesURL.Name, queuesURL },
                { requestsConnectorURL.Name, requestsConnectorURL },
                { subscriptionsURL.Name, subscriptionsURL }
            };

            Right adminRight = new Right { Type = "ADMIN", Value = "APPROVED" };
            Right createRight = new Right { Type = "CREATE", Value = "APPROVED" };
            IDictionary<string, Right> rights = new Dictionary<string, Right> { { adminRight.Type, adminRight } };

            Infrastructure.Service studentPersonalsService = new Infrastructure.Service
            {
                ContextId = "DEFAULT",
                Name = "StudentPersonals",
                Rights = rights,
                Type = "OBJECT"
            };
            Infrastructure.Service schoolInfosService = new Infrastructure.Service
            {
                ContextId = "DEFAULT",
                Name = "SchoolInfos",
                Rights = rights,
                Type = "OBJECT"
            };
            ICollection<Infrastructure.Service> services = new SortedSet<Infrastructure.Service>
            {
                studentPersonalsService, schoolInfosService
            };

            ProvisionedZone schoolZone = new ProvisionedZone { SifId = "auSchoolTestingZone", Services = services };
            ProvisionedZone studentZone = new ProvisionedZone { SifId = "auStudentTestingZone", Services = services };

            IDictionary<string, ProvisionedZone> provisionedZones = new SortedDictionary<string, ProvisionedZone> { { schoolZone.SifId, schoolZone }, { studentZone.SifId, studentZone } };

            Environment environmentResponse = CreateEnvironmentRequest();
            environmentResponse.InfrastructureServices = infrastructureServices;
            environmentResponse.ProvisionedZones = provisionedZones;

            return environmentResponse;
        }