public ServicePolicy GetServicePolicy(Guid serviceId) { DomainPolicy.IPolicy legacyPolicy = GetAdvancedServicePolicy(serviceId); if (legacyPolicy.GetType() != typeof(DomainPolicy.LegacyPolicy)) { Trace.TraceWarning($"Invalid policy type returned to legacy function. To utilize new policies please use GetAdvancedServicePolicy"); return(null); } // This calls ToTransport because the parsing logic that is contained in the ServicePolicy class shouldn't be duplicated return(ServicePolicy.FromTransport((AuthPolicy)legacyPolicy.ToTransport())); }
public void SetAdvancedServicePolicy(Guid serviceId, DomainPolicy.IPolicy policy) { var request = new ServicePolicyPutRequest(serviceId, policy.ToTransport()); _transport.DirectoryV3ServicePolicyPut(request, _directoryId); }
public void SetAdvancedServicePolicy(Guid serviceId, DomainPolicy.IPolicy policy) { var request = new ServicePolicyPutRequest(serviceId, policy.ToTransport()); _transport.OrganizationV3ServicePolicyPut(request, _organizationId); }