Validate method

  1. @override
void Validate()
override
GetClientAccessToken Id and Types GetClientAccessToken Token requests array Get the app manifests. Get the app manifests. Works with Exchange 2013 SP1 or later EWS. The api version supported by the client. The schema version supported by the client. Install App. The manifest's plain text XML stream. Notice: Stream has state. If you want this function read from the expected position of the stream, please make sure set read position by manifestStream.Position = expectedPosition. Be aware read manifestStream.Lengh puts stream's Position at stream end. If you retrieve manifestStream.Lengh before call this function, nothing will be read. When this function succeeds, manifestStream is closed. This is by EWS design to release resource in timely manner. Install App. The manifest's plain text XML stream. Notice: Stream has state. If you want this function read from the expected position of the stream, please make sure set read position by manifestStream.Position = expectedPosition. Be aware read manifestStream.Lengh puts stream's Position at stream end. If you retrieve manifestStream.Lengh before call this function, nothing will be read. When this function succeeds, manifestStream is closed. This is by EWS design to release resource in timely manner. The asset id of the addin in marketplace The target market for content Whether to send welcome email for the addin Uninstall app. App ID Disable App. App ID Disable reason Sets the consent state of an extension. Extension id. Sets the consent state of an extension. Get App Marketplace Url. Get App Marketplace Url. Works with Exchange 2013 SP1 or later EWS. The api version supported by the client. The schema version supported by the client. Get the client extension data. This method is used in server-to-server calls to retrieve ORG extensions for admin powershell/UMC access and user's powershell/UMC access as well as user's activation for OWA/Outlook. This is expected to never be used or called directly from user client. An array of requested extension IDs to return. Whether enabled extension only should be returned, e.g. for user's OWA/Outlook activation scenario. Whether it's called from admin or user scope Specifies optional (if called with user scope) user identity. This will allow to do proper filtering in cases where admin installs an extension for specific users only Optional list of org extension IDs which user enabled. This is necessary for proper result filtering on the server end. E.g. if admin installed N extensions but didn't enable them, it does not make sense to return manifests for those which user never enabled either. Used only when asked for enabled extension only (activation scenario). Optional list of org extension IDs which user disabled. This is necessary for proper result filtering on the server end. E.g. if admin installed N optional extensions and enabled them, it does not make sense to retrieve manifests for extensions which user disabled for him or herself. Used only when asked for enabled extension only (activation scenario). Optional flag to indicate whether it is debug mode. If it is, org master table in arbitration mailbox will be returned for debugging purpose. Get the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to retrieve OME configuration Set the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to set encryption configuration The xml Set the client extension data. This method is used in server-to-server calls to install/uninstall/configure ORG extensions to support admin's management of ORG extensions via powershell/UMC. List of actions to execute. Gets the list of unified groups associated with the user The Requested Unified Groups Sets The smtp address of accessing user. Gets the list of unified groups associated with the user The Requested Unified Groups Sets Gets the list of unified groups associated with the user The Requested Unified Groups Sets The smtp address of accessing user. Gets the UnifiedGroupsUnseenCount for the group specfied The smtpaddress of group for which unseendata is desired The LastVisitedTimeUtc of group for which unseendata is desired Sets the LastVisitedTime for the group specfied The smtpaddress of group for which unseendata is desired The LastVisitedTimeUtc of group for which unseendata is desired Executes the diagnostic method. The verb. The parameter. Validates this instance.

Implementation

//ServiceResponseCollection<GetClientAccessTokenResponse> GetClientAccessToken(Iterable<MapEntry<string, ClientAccessTokenType>> idAndTypes)
//        {
//            GetClientAccessTokenRequest request = new GetClientAccessTokenRequest(this, ServiceErrorHandling.ReturnErrors);
//            List<ClientAccessTokenRequest> requestList = <ClientAccessTokenRequest> [];
//            for (MapEntry<string, ClientAccessTokenType> idAndType in idAndTypes)
//            {
//                ClientAccessTokenRequest clientAccessTokenRequest = new ClientAccessTokenRequest(idAndType.Key, idAndType.Value);
//                requestList.Add(clientAccessTokenRequest);
//            }
//
//            return this.GetClientAccessToken(requestList.ToArray());
//        }

/// <summary>
/// GetClientAccessToken
/// </summary>
/// <param name="tokenRequests">Token requests array</param>
/// <returns>A ServiceResponseCollection providing token results for each of the specified id and types.</returns>
//ServiceResponseCollection<GetClientAccessTokenResponse> GetClientAccessToken(ClientAccessTokenRequest[] tokenRequests)
//        {
//            GetClientAccessTokenRequest request = new GetClientAccessTokenRequest(this, ServiceErrorHandling.ReturnErrors);
//            request.TokenRequests = tokenRequests;
//            return request.Execute();
//        }

/// <summary>
/// Get the app manifests.
/// </summary>
/// <returns>Collection of manifests</returns>
//Collection<XmlDocument> GetAppManifests()
//        {
//            GetAppManifestsRequest request = new GetAppManifestsRequest(this);
//            return request.Execute().Manifests;
//        }

/// <summary>
/// Get the app manifests.  Works with Exchange 2013 SP1 or later EWS.
/// </summary>
/// <param name="apiVersionSupported">The api version supported by the client.</param>
/// <param name="schemaVersionSupported">The schema version supported by the client.</param>
/// <returns>Collection of manifests</returns>
//Collection<ClientApp> GetAppManifests(string apiVersionSupported, string schemaVersionSupported)
//        {
//            GetAppManifestsRequest request = new GetAppManifestsRequest(this);
//            request.ApiVersionSupported = apiVersionSupported;
//            request.SchemaVersionSupported = schemaVersionSupported;
//
//            return request.Execute().Apps;
//        }

/// <summary>
/// Install App.
/// </summary>
/// <param name="manifestStream">The manifest's plain text XML stream.
/// Notice: Stream has state. If you want this function read from the expected position of the stream,
/// please make sure set read position by manifestStream.Position = expectedPosition.
/// Be aware read manifestStream.Lengh puts stream's Position at stream end.
/// If you retrieve manifestStream.Lengh before call this function, nothing will be read.
/// When this function succeeds, manifestStream is closed. This is by EWS design to
/// release resource in timely manner. </param>
/// <remarks>Exception will be thrown for errors. </remarks>
//void InstallApp(Stream manifestStream)
//        {
//            EwsUtilities.ValidateParam(manifestStream, "manifestStream");
//
//            this.InternalInstallApp(manifestStream, marketplaceAssetId: null, marketplaceContentMarket: null, sendWelcomeEmail: false);
//        }

/// <summary>
/// Install App.
/// </summary>
/// <param name="manifestStream">The manifest's plain text XML stream.
/// Notice: Stream has state. If you want this function read from the expected position of the stream,
/// please make sure set read position by manifestStream.Position = expectedPosition.
/// Be aware read manifestStream.Lengh puts stream's Position at stream end.
/// If you retrieve manifestStream.Lengh before call this function, nothing will be read.
/// When this function succeeds, manifestStream is closed. This is by EWS design to
/// release resource in timely manner. </param>
/// <param name="marketplaceAssetId">The asset id of the addin in marketplace</param>
/// <param name="marketplaceContentMarket">The target market for content</param>
/// <param name="sendWelcomeEmail">Whether to send welcome email for the addin</param>
/// <returns>True if the app was not already installed. False if it was not installed. Null if it is not a user mailbox.</returns>
/// <remarks>Exception will be thrown for errors. </remarks>
//        bool? InternalInstallApp(Stream manifestStream, string marketplaceAssetId, string marketplaceContentMarket, bool sendWelcomeEmail)
//        {
//            EwsUtilities.ValidateParam(manifestStream, "manifestStream");
//
//            InstallAppRequest request = new InstallAppRequest(this, manifestStream, marketplaceAssetId, marketplaceContentMarket, false);
//
//            InstallAppResponse response = request.Execute();
//
//            return response.WasFirstInstall;
//        }

/// <summary>
/// Uninstall app.
/// </summary>
/// <param name="id">App ID</param>
/// <remarks>Exception will be thrown for errors. </remarks>
//void UninstallApp(string id)
//        {
//            EwsUtilities.ValidateParam(id, "id");
//
//            UninstallAppRequest request = new UninstallAppRequest(this, id);
//
//            request.Execute();
//        }

/// <summary>
/// Disable App.
/// </summary>
/// <param name="id">App ID</param>
/// <param name="disableReason">Disable reason</param>
/// <remarks>Exception will be thrown for errors. </remarks>
//void DisableApp(string id, DisableReasonType disableReason)
//        {
//            EwsUtilities.ValidateParam(id, "id");
//            EwsUtilities.ValidateParam(disableReason, "disableReason");
//
//            DisableAppRequest request = new DisableAppRequest(this, id, disableReason);
//
//            request.Execute();
//        }

/// <summary>
/// Sets the consent state of an extension.
/// </summary>
/// <param name="id">Extension id.</param>
/// <param name="state">Sets the consent state of an extension.</param>
/// <remarks>Exception will be thrown for errors. </remarks>
//void RegisterConsent(string id, ConsentState state)
//        {
//            EwsUtilities.ValidateParam(id, "id");
//            EwsUtilities.ValidateParam(state, "state");
//
//            RegisterConsentRequest request = new RegisterConsentRequest(this, id, state);
//
//            request.Execute();
//        }

/// <summary>
/// Get App Marketplace Url.
/// </summary>
/// <remarks>Exception will be thrown for errors. </remarks>
//String GetAppMarketplaceUrl()
//        {
//            return GetAppMarketplaceUrl(null, null);
//        }

/// <summary>
/// Get App Marketplace Url.  Works with Exchange 2013 SP1 or later EWS.
/// </summary>
/// <param name="apiVersionSupported">The api version supported by the client.</param>
/// <param name="schemaVersionSupported">The schema version supported by the client.</param>
/// <remarks>Exception will be thrown for errors. </remarks>
//String GetAppMarketplaceUrl(string apiVersionSupported, string schemaVersionSupported)
//        {
//            GetAppMarketplaceUrlRequest request = new GetAppMarketplaceUrlRequest(this);
//            request.ApiVersionSupported = apiVersionSupported;
//            request.SchemaVersionSupported = schemaVersionSupported;
//
//            return request.Execute().AppMarketplaceUrl;
//        }

/// <summary>
/// Get the client extension data. This method is used in server-to-server calls to retrieve ORG extensions for
/// admin powershell/UMC access and user's powershell/UMC access as well as user's activation for OWA/Outlook.
/// This is expected to never be used or called directly from user client.
/// </summary>
/// <param name="requestedExtensionIds">An array of requested extension IDs to return.</param>
/// <param name="shouldReturnEnabledOnly">Whether enabled extension only should be returned, e.g. for user's
/// OWA/Outlook activation scenario.</param>
/// <param name="isUserScope">Whether it's called from admin or user scope</param>
/// <param name="userId">Specifies optional (if called with user scope) user identity. This will allow to do proper
/// filtering in cases where admin installs an extension for specific users only</param>
/// <param name="userEnabledExtensionIds">Optional list of org extension IDs which user enabled. This is necessary for
/// proper result filtering on the server end. E.g. if admin installed N extensions but didn't enable them, it does not
/// make sense to return manifests for those which user never enabled either. Used only when asked
/// for enabled extension only (activation scenario).</param>
/// <param name="userDisabledExtensionIds">Optional list of org extension IDs which user disabled. This is necessary for
/// proper result filtering on the server end. E.g. if admin installed N optional extensions and enabled them, it does
/// not make sense to retrieve manifests for extensions which user disabled for him or herself. Used only when asked
/// for enabled extension only (activation scenario).</param>
/// <param name="isDebug">Optional flag to indicate whether it is debug mode.
/// If it is, org master table in arbitration mailbox will be returned for debugging purpose.</param>
/// <returns>Collection of ClientExtension objects</returns>
//GetClientExtensionResponse GetClientExtension(
//            StringList requestedExtensionIds,
//            bool shouldReturnEnabledOnly,
//            bool isUserScope,
//            string userId,
//            StringList userEnabledExtensionIds,
//            StringList userDisabledExtensionIds,
//            bool isDebug)
//        {
//            GetClientExtensionRequest request = new GetClientExtensionRequest(
//                this,
//                requestedExtensionIds,
//                shouldReturnEnabledOnly,
//                isUserScope,
//                userId,
//                userEnabledExtensionIds,
//                userDisabledExtensionIds,
//                isDebug);
//
//            return request.Execute();
//        }

/// <summary>
/// Get the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to retrieve OME configuration
/// </summary>
/// <returns>OME Configuration response object</returns>
//GetOMEConfigurationResponse GetOMEConfiguration()
//        {
//            GetOMEConfigurationRequest request = new GetOMEConfigurationRequest(this);
//
//            return request.Execute();
//        }

/// <summary>
/// Set the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to set encryption configuration
/// </summary>
/// <param name="xml">The xml</param>
//void SetOMEConfiguration(string xml)
//        {
//            SetOMEConfigurationRequest request = new SetOMEConfigurationRequest(this, xml);
//
//            request.Execute();
//        }

/// <summary>
/// Set the client extension data. This method is used in server-to-server calls to install/uninstall/configure ORG
/// extensions to support admin's management of ORG extensions via powershell/UMC.
/// </summary>
/// <param name="actions">List of actions to execute.</param>
//void SetClientExtension(List<SetClientExtensionAction> actions)
//        {
//            SetClientExtensionRequest request = new SetClientExtensionRequest(this, actions);
//
//            request.Execute();
//        }

/// <summary>
/// Gets the list of unified groups associated with the user
/// </summary>
/// <param name="requestedUnifiedGroupsSets">The Requested Unified Groups Sets</param>
/// <param name="userSmtpAddress">The smtp address of accessing user.</param>
/// <returns>UserUnified groups.</returns>
//Collection<UnifiedGroupsSet> GetUserUnifiedGroups(
//                            Iterable<RequestedUnifiedGroupsSet> requestedUnifiedGroupsSets,
//                            string userSmtpAddress)
//        {
//            EwsUtilities.ValidateParam(requestedUnifiedGroupsSets, "requestedUnifiedGroupsSets");
//            EwsUtilities.ValidateParam(userSmtpAddress, "userSmtpAddress");
//
//            return this.GetUserUnifiedGroupsInternal(requestedUnifiedGroupsSets, userSmtpAddress);
//        }

/// <summary>
/// Gets the list of unified groups associated with the user
/// </summary>
/// <param name="requestedUnifiedGroupsSets">The Requested Unified Groups Sets</param>
/// <returns>UserUnified groups.</returns>
//Collection<UnifiedGroupsSet> GetUserUnifiedGroups(Iterable<RequestedUnifiedGroupsSet> requestedUnifiedGroupsSets)
//        {
//            EwsUtilities.ValidateParam(requestedUnifiedGroupsSets, "requestedUnifiedGroupsSets");
//            return this.GetUserUnifiedGroupsInternal(requestedUnifiedGroupsSets, null);
//        }

/// <summary>
/// Gets the list of unified groups associated with the user
/// </summary>
/// <param name="requestedUnifiedGroupsSets">The Requested Unified Groups Sets</param>
/// <param name="userSmtpAddress">The smtp address of accessing user.</param>
/// <returns>UserUnified groups.</returns>
//Collection<UnifiedGroupsSet> GetUserUnifiedGroupsInternal(
//                            Iterable<RequestedUnifiedGroupsSet> requestedUnifiedGroupsSets,
//                            string userSmtpAddress)
//        {
//            GetUserUnifiedGroupsRequest request = new GetUserUnifiedGroupsRequest(this);
//
//            if (!StringUtils.IsNullOrEmpty(userSmtpAddress))
//            {
//                request.UserSmtpAddress = userSmtpAddress;
//            }
//
//            if (requestedUnifiedGroupsSets != null)
//            {
//                request.RequestedUnifiedGroupsSets = requestedUnifiedGroupsSets;
//            }
//
//            return request.Execute().GroupsSets;
//        }

/// <summary>
/// Gets the UnifiedGroupsUnseenCount for the group specfied
/// </summary>
/// <param name="groupMailboxSmtpAddress">The smtpaddress of group for which unseendata is desired</param>
/// <param name="lastVisitedTimeUtc">The LastVisitedTimeUtc of group for which unseendata is desired</param>
/// <returns>UnifiedGroupsUnseenCount</returns>
//int GetUnifiedGroupUnseenCount(string groupMailboxSmtpAddress, DateTime lastVisitedTimeUtc)
//        {
//            EwsUtilities.ValidateParam(groupMailboxSmtpAddress, "groupMailboxSmtpAddress");
//
//            GetUnifiedGroupUnseenCountRequest request = new GetUnifiedGroupUnseenCountRequest(
//                this, lastVisitedTimeUtc, UnifiedGroupIdentityType.SmtpAddress, groupMailboxSmtpAddress);
//
//            request.AnchorMailbox = groupMailboxSmtpAddress;
//
//            return request.Execute().UnseenCount;
//        }

/// <summary>
/// Sets the LastVisitedTime for the group specfied
/// </summary>
/// <param name="groupMailboxSmtpAddress">The smtpaddress of group for which unseendata is desired</param>
/// <param name="lastVisitedTimeUtc">The LastVisitedTimeUtc of group for which unseendata is desired</param>
//void SetUnifiedGroupLastVisitedTime(string groupMailboxSmtpAddress, DateTime lastVisitedTimeUtc)
//        {
//            EwsUtilities.ValidateParam(groupMailboxSmtpAddress, "groupMailboxSmtpAddress");
//
//            SetUnifiedGroupLastVisitedTimeRequest request = new SetUnifiedGroupLastVisitedTimeRequest(this, lastVisitedTimeUtc, UnifiedGroupIdentityType.SmtpAddress, groupMailboxSmtpAddress);
//
//            request.Execute();
//        }

/// <summary>
/// Executes the diagnostic method.
/// </summary>
/// <param name="verb">The verb.</param>
/// <param name="parameter">The parameter.</param>
/// <returns></returns>
//  XmlDocument ExecuteDiagnosticMethod(string verb, XmlNode parameter) {
//    ExecuteDiagnosticMethodRequest request = new ExecuteDiagnosticMethodRequest(
//        this);
//    request.Verb = verb;
//    request.Parameter = parameter;
//
//    return request.Execute()[0].ReturnValue;
//  }

/// <summary>
/// Validates this instance.
/// </summary>
@override
void Validate() {
  super.Validate();

  if (this.Url == null) {
    throw new ServiceLocalException("Strings.ServiceUrlMustBeSet");
  }

  // todo("fix PrivilegedUserId and ImpersonatedUserId check")
//    if (this.PrivilegedUserId != null && this.ImpersonatedUserId != null) {
//      throw new ServiceLocalException(
//          Strings.CannotSetBothImpersonatedAndPrivilegedUser);
//    }

  // only one of PrivilegedUserId|ImpersonatedUserId|ManagementRoles can be set.
}