Domain property

String? get Domain
Retrieves the specified settings for a set of users. The SMTP addresses of the users. The user setting names. Retrieves the specified settings for a domain. The domain. Requested version of the Exchange service. The domain setting names. Retrieves the specified settings for a set of domains. The SMTP addresses of the domains. Requested version of the Exchange service. The domain setting names. Try to get the partner access information for the given target tenant. The target domain or user email address. The partner access credentials. The autodiscover url for the given tenant. Gets or sets the domain this service is bound to. When this property is set, the domain name is used to automatically determine the Autodiscover service URL.

Implementation

// GetUserSettingsResponseCollection GetUsersSettings(
//            Iterable<String> userSmtpAddresses,
//            params UserSettingName[] userSettingNames)
//        {
//            if (this.RequestedServerVersion < MinimumRequestVersionForAutoDiscoverSoapService)
//            {
//                throw new ServiceVersionException(
//                    string.Format(Strings.AutodiscoverServiceIncompatibleWithRequestVersion, MinimumRequestVersionForAutoDiscoverSoapService));
//            }
//
//            List<String> smtpAddresses = <String> [](userSmtpAddresses);
//            List<UserSettingName> settings = <UserSettingName> [](userSettingNames);
//
//            return this.GetUserSettings(smtpAddresses, settings);
//        }

/// <summary>
/// Retrieves the specified settings for a domain.
/// </summary>
/// <param name="domain">The domain.</param>
/// <param name="requestedVersion">Requested version of the Exchange service.</param>
/// <param name="domainSettingNames">The domain setting names.</param>
/// <returns>A DomainResponse object containing the requested settings for the specified domain.</returns>
// GetDomainSettingsResponse GetDomainSettings(
//            String domain,
//            ExchangeVersion requestedVersion,
//            params DomainSettingName[] domainSettingNames)
//        {
//            List<String> domains = <String> [](1);
//            domains.Add(domain);
//            List<DomainSettingName> settings = <DomainSettingName> [](domainSettingNames);
//            return this.GetDomainSettings(domains, settings, requestedVersion)[0];
//        }

/// <summary>
/// Retrieves the specified settings for a set of domains.
/// </summary>
/// <param name="domains">The SMTP addresses of the domains.</param>
/// <param name="requestedVersion">Requested version of the Exchange service.</param>
/// <param name="domainSettingNames">The domain setting names.</param>
/// <returns>A GetDomainSettingsResponseCollection object containing the responses for each individual domain.</returns>
// GetDomainSettingsResponseCollection GetDomainSettings(
//            Iterable<String> domains,
//            ExchangeVersion requestedVersion,
//            List<DomainSettingName> domainSettingNames)
//        {
//            List<DomainSettingName> settings = <DomainSettingName> [].of(domainSettingNames);
//
//            return this.GetDomainSettings(domains.toList(), settings, requestedVersion);
//        }

/// <summary>
/// Try to get the partner access information for the given target tenant.
/// </summary>
/// <param name="targetTenantDomain">The target domain or user email address.</param>
/// <param name="partnerAccessCredentials">The partner access credentials.</param>
/// <param name="targetTenantAutodiscoverUrl">The autodiscover url for the given tenant.</param>
/// <returns>True if the partner access information was retrieved, false otherwise.</returns>
// bool TryGetPartnerAccess(
//            String targetTenantDomain,
//            out ExchangeCredentials partnerAccessCredentials,
//            out Uri targetTenantAutodiscoverUrl)
//        {
//            EwsUtilities.ValidateNonBlankStringParam(targetTenantDomain, "targetTenantDomain");
//
//            // the user should set the url to its own tenant's autodiscover url.
//            //
//            if (this.Url == null)
//            {
//                throw new ServiceValidationException(Strings.PartnerTokenRequestRequiresUrl);
//            }
//
//            if (this.RequestedServerVersion < ExchangeVersion.Exchange2010_SP1)
//            {
//                throw new ServiceVersionException(
//                    string.Format(
//                        Strings.PartnerTokenIncompatibleWithRequestVersion,
//                        ExchangeVersion.Exchange2010_SP1));
//            }
//
//            partnerAccessCredentials = null;
//            targetTenantAutodiscoverUrl = null;
//
//            String smtpAddress = targetTenantDomain;
//            if (!smtpAddress.Contains("@"))
//            {
//                smtpAddress = "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}@" + targetTenantDomain;
//            }
//
//            GetUserSettingsRequest request = new GetUserSettingsRequest(this, this.Url, true /* expectPartnerToken */);
//            request.SmtpAddresses = <String> [](new[] { smtpAddress });
//            request.Settings = <UserSettingName> [](new[] { UserSettingName.ExternalEwsUrl });
//
//            GetUserSettingsResponseCollection response = null;
//            try
//            {
//                response = request.Execute();
//            }
//            catch (ServiceRequestException)
//            {
//                return false;
//            }
//            catch (ServiceRemoteException)
//            {
//                return false;
//            }
//
//            if (StringUtils.IsNullOrEmpty(request.PartnerToken)
//                || StringUtils.IsNullOrEmpty(request.PartnerTokenReference))
//            {
//                return false;
//            }
//
//            if (response.ErrorCode == AutodiscoverErrorCode.NoError)
//            {
//                GetUserSettingsResponse firstResponse = response.Responses[0];
//                if (firstResponse.ErrorCode == AutodiscoverErrorCode.NoError)
//                {
//                    targetTenantAutodiscoverUrl = this.Url;
//                }
//                else if (firstResponse.ErrorCode == AutodiscoverErrorCode.RedirectUrl)
//                {
//                    targetTenantAutodiscoverUrl = new Uri(firstResponse.RedirectTarget);
//                }
//                else
//                {
//                    return false;
//                }
//            }
//            else
//            {
//                return false;
//            }
//
//            partnerAccessCredentials = new PartnerTokenCredentials(
//                request.PartnerToken,
//                request.PartnerTokenReference);
//
//            targetTenantAutodiscoverUrl = partnerAccessCredentials.AdjustUrl(
//                targetTenantAutodiscoverUrl);
//
//            return true;
//        }

/// <summary>
/// Gets or sets the domain this service is bound to. When this property is set, the domain
/// name is used to automatically determine the Autodiscover service URL.
/// </summary>
String? get Domain => this._domain;
set Domain (String? value)

Implementation

set Domain(String? value) {
  EwsUtilities.ValidateDomainNameAllowNull(value, "Domain");

  // If Domain property is set to non-null value, Url property is nulled.
  if (value != null) {
    this._url = null;
  }
  this._domain = value;
}