Exemplo n.º 1
0
        public void SaveAndReadTest()
        {
            entry.Properties.Add(new PropertyElement("name", "value"));

            StringBuilder sb = new StringBuilder();
            XmlWriter writer = new XmlTextWriter(new StringWriter(sb));
            entry.SaveToXml(writer);
            writer.Close();

            XmlDocument document = new XmlDocument();
            document.LoadXml(sb.ToString());

            AdminSettingsEntry newEntry = new AdminSettingsEntry();
            foreach (XmlNode node in document.FirstChild.ChildNodes)
            {
                ExtensionElementEventArgs args = new ExtensionElementEventArgs();
                args.ExtensionElement = node;
                args.Base = newEntry;
                newEntry.Parse(args, new AtomFeedParser());
            }

            Assert.AreEqual(entry.Properties[0].Name, newEntry.Properties[0].Name,
                "Parsed entry should have same name for property[0] as original entry");
            Assert.AreEqual(entry.Properties[0].Value, newEntry.Properties[0].Value,
                "Parsed entry should have same value for property[0] as original entry");
        }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the domain's Custom Logo
 /// </summary>
 /// <param name="base64EncodedLogoImage">base 64 encoded binary data of logo image</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateCustomLogo(string base64EncodedLogoImage)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.CustomLogoUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.LogoImage, base64EncodedLogoImage));
     return base.Update<AdminSettingsEntry>(entry);            
 }
Exemplo n.º 3
0
 /// <summary>
 /// Updates the domain's MX verification status
 /// </summary>        
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateMxVerificationStatus()
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.MxUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.Verified, Boolean.TrueString));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's default language
 /// </summary>
 /// <param name="defaultLanguage">the new default language for the domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateDefaultLanguage(string defaultLanguage)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.DefaultLanguageUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.DefaultLanguage, defaultLanguage));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Updates the domain's organization name
 /// </summary>
 /// <param name="organizationName">the new organization name for the domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateOrganizationName(string organizationName)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.OrganizationNameUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.OrganizationName, organizationName));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Updates the domain's default language
 /// </summary>
 /// <param name="defaultLanguage">the new default language for the domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateDefaultLanguage(string defaultLanguage)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.DefaultLanguageUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.DefaultLanguage, defaultLanguage));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Updates the domain's Migration Access settings
 /// </summary>
 /// <param name="enableUserMigration">Enable or Disable User migration for the domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateMigrationAccess(Boolean enableUserMigration)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.MigrationUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.EnableUserMigration, enableUserMigration.ToString()));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Updates the domain's SSO Signing Key
 /// </summary>
 /// <param name="base64EncodedSigningKey">yourBase64EncodedPublicKey</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateSsoSigningkey(string base64EncodedSigningKey)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.SsoSigningkeyUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SigningKey, base64EncodedSigningKey));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Updates the domain's Administrator Secondary Email address
 /// </summary>
 /// <param name="adminSecondaryEmail">the new domain's admin Secondary Email domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateAdminSecondaryEmail(string adminSecondaryEmail)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.AdminSecondaryEmailUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(
         new PropertyElement(AppsDomainSettingsNameTable.AdminSecondaryEmail, adminSecondaryEmail));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Updates the domain's Email Gateway settings
 /// </summary>
 /// <param name="smartHost">Either the IP address or hostname of your SMTP server.
 /// Google Apps routes outgoing mail to this server.</param>
 /// <param name="smtpMode"> The default value is SMTP. Another value, SMTP_TLS,
 /// secures a connection with TLS when delivering the message. </param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateEmailGateway(string smartHost, string smtpMode)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.GatewayUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SmartHost, smartHost));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SmtpMode, smtpMode));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Updates the domain's SSO settings
 /// </summary>        
 /// <param name="enableSSO">Enable or Disable SSO for the domain</param>
 /// <param name="samlSignonUri">http://www.example.com/sso/signon</param>
 /// <param name="samlLogoutUri">http://www.example.com/sso/logout</param>
 /// <param name="changePasswordUri">http://www.example.com/sso/changepassword</param>
 /// <param name="ssoWhitelist">CIDR formated IP address</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateSsoSettings( Boolean enableSSO, String samlSignonUri,
     String samlLogoutUri, String changePasswordUri, String ssoWhitelist, Boolean useDomainSpecificIssuer)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.SsoGeneralUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.EnableSSO, enableSSO.ToString()));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SamlSignonUri, samlSignonUri));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SamlLogoutUri, samlLogoutUri));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.ChangePasswordUri, changePasswordUri));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SsoWhitelist, ssoWhitelist));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.UseDomainSpecificIssuer, useDomainSpecificIssuer.ToString()));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's Email Gateway settings
 /// </summary>
 /// <param name="smartHost">Either the IP address or hostname of your SMTP server.
 /// Google Apps routes outgoing mail to this server.</param>
 /// <param name="smtpMode"> The default value is SMTP. Another value, SMTP_TLS,
 /// secures a connection with TLS when delivering the message. </param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateEmailGateway(string smartHost, string smtpMode)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.GatewayUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SmartHost, smartHost));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SmtpMode, smtpMode));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's Migration Access settings
 /// </summary>
 /// <param name="enableUserMigration">Enable or Disable User migration for the domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateMigrationAccess(Boolean enableUserMigration)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.MigrationUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.EnableUserMigration, enableUserMigration.ToString()));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's SSO Signing Key
 /// </summary>
 /// <param name="base64EncodedSigningKey">yourBase64EncodedPublicKey</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateSsoSigningkey(string base64EncodedSigningKey)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.SsoSigningkeyUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SigningKey, base64EncodedSigningKey));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's SSO settings
 /// </summary>        
 /// <param name="enableSSO">Enable or Disable SSO for the domain</param>
 /// <param name="samlSignonUri">http://www.example.com/sso/signon</param>
 /// <param name="samlLogoutUri">http://www.example.com/sso/logout</param>
 /// <param name="changePasswordUri">http://www.example.com/sso/changepassword</param>
 /// <param name="ssoWhitelist">CIDR formated IP address</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateSsoSettings( Boolean enableSSO, String samlSignonUri,
     String samlLogoutUri, String changePasswordUri, String ssoWhitelist, Boolean useDomainSpecificIssuer)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.SsoGeneralUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.EnableSSO, enableSSO.ToString()));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SamlSignonUri, samlSignonUri));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SamlLogoutUri, samlLogoutUri));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.ChangePasswordUri, changePasswordUri));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.SsoWhitelist, ssoWhitelist));
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.UseDomainSpecificIssuer, useDomainSpecificIssuer.ToString()));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's MX verification status
 /// </summary>        
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateMxVerificationStatus()
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.MxUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.Verified, Boolean.TrueString));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's Custom Logo
 /// </summary>
 /// <param name="base64EncodedLogoImage">base 64 encoded binary data of logo image</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateCustomLogo(string base64EncodedLogoImage)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.CustomLogoUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.LogoImage, base64EncodedLogoImage));
     return base.Update<AdminSettingsEntry>(entry);            
 }
 /// <summary>
 /// Updates the domain's Administrator Secondary Email address
 /// </summary>
 /// <param name="adminSecondaryEmail">the new domain's admin Secondary Email domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateAdminSecondaryEmail(string adminSecondaryEmail)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.AdminSecondaryEmailUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(
         new PropertyElement(AppsDomainSettingsNameTable.AdminSecondaryEmail, adminSecondaryEmail));
     return base.Update<AdminSettingsEntry>(entry);
 }
 /// <summary>
 /// Updates the domain's organization name
 /// </summary>
 /// <param name="organizationName">the new organization name for the domain</param>
 /// <returns>a <code>AdminSettingsEntry</code> containing the results of the
 /// operation</returns>
 public AdminSettingsEntry UpdateOrganizationName(string organizationName)
 {
     string uri = AppsDomainSettingsNameTable.AppsAdminSettingsBaseFeedUri
        + domain + AppsDomainSettingsNameTable.OrganizationNameUriSuffix;
     AdminSettingsEntry entry = new AdminSettingsEntry();
     entry.EditUri = uri;
     entry.Properties.Add(new PropertyElement(AppsDomainSettingsNameTable.OrganizationName, organizationName));
     return base.Update<AdminSettingsEntry>(entry);
 }
Exemplo n.º 20
0
 public void Init()
 {
     entry = new AdminSettingsEntry();
 }