InternalGetAttachments method

Future<ServiceResponseCollection<GetAttachmentResponse>> InternalGetAttachments(
  1. Iterable<Attachment> attachments,
  2. BodyType? bodyType,
  3. Iterable<PropertyDefinitionBase>? additionalProperties,
  4. ServiceErrorHandling errorHandling,
)
Mark items as junk. ItemIds for the items to mark Whether the items are junk. If true, senders are add to blocked sender list. If false, senders are removed. Whether to move the item. Items are moved to junk folder if isJunk is true, inbox if isJunk is false. This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions. Id of the folder being searched The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection The view which defines the number of persona being returned The query string for which the search is being performed This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions. Name of the folder being searched The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection The view which defines the number of persona being returned The query string for which the search is being performed This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions. Browse scenariosdon't require query string. Id of the folder being browsed Search filter The view which defines paging and the number of persona being returned This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions. Browse scenarios don't require query string. Name of the folder being browsed Search filter The view which defines paging and the number of personas being returned Retrieves all people who are relevant to the user The view which defines the number of personas being returned Retrieves all people who are relevant to the user The view which defines the number of personas being returned The context for this query. See PeopleQueryContextKeys for keys Searches for people who are relevant to the user, automatically determining the best sources to use. The view which defines the number of personas being returned The query string for which the search is being performed Searches for people who are relevant to the user The view which defines the number of personas being returned The query string for which the search is being performed The context for this query. See PeopleQueryContextKeys for keys The scope of the query. Performs a People Query FindPeople call The view which defines the number of personas being returned The query string for which the search is being performed The context for this query The scope of the query. Get a user's photo. The user's email address The desired size of the returned photo. Valid photo sizes are in UserPhotoSize A photo's cache ID which will allow the caller to ensure their cached photo is up to date Set a user's photo. The user's email address The photo to set Begins an async request for a user photo An AsyncCallback delegate An object that contains state information for this request The user's email address The desired size of the returned photo. Valid photo sizes are in UserPhotoSize A photo's cache ID which will allow the caller to ensure their cached photo is up to date Ends an async request for a user's photo An IAsyncResult that references the asynchronous request. This method is for retreiving people insight for given email addresses Specified eamiladdresses to retrieve Gets an attachment. The attachments. Type of the body. The additional properties. Type of error handling to perform.

Implementation

//ServiceResponseCollection<MarkAsJunkResponse> MarkAsJunk(Iterable<ItemId> itemIds, bool isJunk, bool moveItem)
//        {
//            MarkAsJunkRequest request = new MarkAsJunkRequest(this, ServiceErrorHandling.ReturnErrors);
//            request.ItemIds.AddRange(itemIds);
//            request.IsJunk = isJunk;
//            request.MoveItem = moveItem;
//            return request.Execute();
//        }

/// <summary>
/// This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions.
/// </summary>
/// <param name="folderId">Id of the folder being searched</param>
/// <param name="searchFilter">The search filter. Available search filter classes
/// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and
/// SearchFilter.SearchFilterCollection</param>
/// <param name="view">The view which defines the number of persona being returned</param>
/// <param name="queryString">The query string for which the search is being performed</param>
/// <returns>A collection of personas matching the search conditions</returns>
//ICollection<Persona> FindPeople(FolderId folderId, SearchFilter searchFilter, ViewBase view, string queryString)
//        {
//            EwsUtilities.ValidateParamAllowNull(folderId, "folderId");
//            EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter");
//            EwsUtilities.ValidateParam(view, "view");
//            EwsUtilities.ValidateParam(queryString, "queryString");
//            EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013_SP1, "FindPeople");
//
//            FindPeopleRequest request = new FindPeopleRequest(this);
//
//            request.FolderId = folderId;
//            request.SearchFilter = searchFilter;
//            request.View = view;
//            request.QueryString = queryString;
//
//            return request.Execute().Personas;
//        }

/// <summary>
/// This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions.
/// </summary>
/// <param name="folderName">Name of the folder being searched</param>
/// <param name="searchFilter">The search filter. Available search filter classes
/// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and
/// SearchFilter.SearchFilterCollection</param>
/// <param name="view">The view which defines the number of persona being returned</param>
/// <param name="queryString">The query string for which the search is being performed</param>
/// <returns>A collection of personas matching the search conditions</returns>
//ICollection<Persona> FindPeople(WellKnownFolderName folderName, SearchFilter searchFilter, ViewBase view, string queryString)
//        {
//            return this.FindPeople(new FolderId(folderName), searchFilter, view, queryString);
//        }

/// <summary>
/// This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions.
/// Browse scenariosdon't require query string.
/// </summary>
/// <param name="folderId">Id of the folder being browsed</param>
/// <param name="searchFilter">Search filter</param>
/// <param name="view">The view which defines paging and the number of persona being returned</param>
/// <returns>A result object containing resultset for browsing</returns>
//FindPeopleResults FindPeople(FolderId folderId, SearchFilter searchFilter, ViewBase view)
//        {
//            EwsUtilities.ValidateParamAllowNull(folderId, "folderId");
//            EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter");
//            EwsUtilities.ValidateParamAllowNull(view, "view");
//            EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013_SP1, "FindPeople");
//
//            FindPeopleRequest request = new FindPeopleRequest(this);
//
//            request.FolderId = folderId;
//            request.SearchFilter = searchFilter;
//            request.View = view;
//
//            return request.Execute().Results;
//        }

/// <summary>
/// This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions.
/// Browse scenarios don't require query string.
/// </summary>
/// <param name="folderName">Name of the folder being browsed</param>
/// <param name="searchFilter">Search filter</param>
/// <param name="view">The view which defines paging and the number of personas being returned</param>
/// <returns>A result object containing resultset for browsing</returns>
//FindPeopleResults FindPeople(WellKnownFolderName folderName, SearchFilter searchFilter, ViewBase view)
//        {
//            return this.FindPeople(new FolderId(folderName), searchFilter, view);
//        }

/// <summary>
/// Retrieves all people who are relevant to the user
/// </summary>
/// <param name="view">The view which defines the number of personas being returned</param>
/// <returns>A collection of personas matching the query string</returns>
//IPeopleQueryResults BrowsePeople(ViewBase view)
//        {
//            return this.BrowsePeople(view, null);
//        }

/// <summary>
/// Retrieves all people who are relevant to the user
/// </summary>
/// <param name="view">The view which defines the number of personas being returned</param>
/// <param name="context">The context for this query. See PeopleQueryContextKeys for keys</param>
/// <returns>A collection of personas matching the query string</returns>
//IPeopleQueryResults BrowsePeople(ViewBase view, Dictionary<string, string> context)
//        {
//            return this.PerformPeopleQuery(view, "", context, null);
//        }

/// <summary>
/// Searches for people who are relevant to the user, automatically determining
/// the best sources to use.
/// </summary>
/// <param name="view">The view which defines the number of personas being returned</param>
/// <param name="queryString">The query string for which the search is being performed</param>
/// <returns>A collection of personas matching the query string</returns>
//IPeopleQueryResults SearchPeople(ViewBase view, string queryString)
//        {
//            return this.SearchPeople(view, queryString, null, null);
//        }

/// <summary>
/// Searches for people who are relevant to the user
/// </summary>
/// <param name="view">The view which defines the number of personas being returned</param>
/// <param name="queryString">The query string for which the search is being performed</param>
/// <param name="context">The context for this query. See PeopleQueryContextKeys for keys</param>
/// <param name="queryMode">The scope of the query.</param>
/// <returns>A collection of personas matching the query string</returns>
//IPeopleQueryResults SearchPeople(ViewBase view, string queryString, Dictionary<string, string> context, PeopleQueryMode queryMode)
//        {
//            EwsUtilities.ValidateParam(queryString, "queryString");
//
//            return this.PerformPeopleQuery(view, queryString, context, queryMode);
//        }

/// <summary>
/// Performs a People Query FindPeople call
/// </summary>
/// <param name="view">The view which defines the number of personas being returned</param>
/// <param name="queryString">The query string for which the search is being performed</param>
/// <param name="context">The context for this query</param>
/// <param name="queryMode">The scope of the query.</param>
/// <returns></returns>
//IPeopleQueryResults PerformPeopleQuery(ViewBase view, string queryString, Dictionary<string, string> context, PeopleQueryMode queryMode)
//        {
//            EwsUtilities.ValidateParam(view, "view");
//            EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2015, "FindPeople");
//
//            if (context == null)
//            {
//                context = new Dictionary<string, string>();
//            }
//
//            if (queryMode == null)
//            {
//                queryMode = PeopleQueryMode.Auto;
//            }
//
//            FindPeopleRequest request = new FindPeopleRequest(this);
//            request.View = view;
//            request.QueryString = queryString;
//            request.SearchPeopleSuggestionIndex = true;
//            request.Context = context;
//            request.QueryMode = queryMode;
//
//            FindPeopleResponse response = request.Execute();
//
//            PeopleQueryResults results = new PeopleQueryResults();
//            results.Personas = response.Personas.ToList();
//            results.TransactionId = response.TransactionId;
//
//            return results;
//        }

/// <summary>
/// Get a user's photo.
/// </summary>
/// <param name="emailAddress">The user's email address</param>
/// <param name="userPhotoSize">The desired size of the returned photo. Valid photo sizes are in UserPhotoSize</param>
/// <param name="entityTag">A photo's cache ID which will allow the caller to ensure their cached photo is up to date</param>
/// <returns>A result object containing the photo state</returns>
//GetUserPhotoResults GetUserPhoto(string emailAddress, string userPhotoSize, string entityTag)
//        {
//            EwsUtilities.ValidateParam(emailAddress, "emailAddress");
//            EwsUtilities.ValidateParam(userPhotoSize, "userPhotoSize");
//            EwsUtilities.ValidateParamAllowNull(entityTag, "entityTag");
//
//            GetUserPhotoRequest request = new GetUserPhotoRequest(this);
//
//            request.EmailAddress = emailAddress;
//            request.UserPhotoSize = userPhotoSize;
//            request.EntityTag = entityTag;
//
//            return request.Execute().Results;
//        }

/// <summary>
/// Set a user's photo.
/// </summary>
/// <param name="emailAddress">The user's email address</param>
/// <param name="photo">The photo to set</param>
/// <returns>A result object</returns>
//SetUserPhotoResults SetUserPhoto(string emailAddress, Uint8List photo)
//        {
//            EwsUtilities.ValidateParam(emailAddress, "emailAddress");
//            EwsUtilities.ValidateParam(photo, "photo");
//
//            SetUserPhotoRequest request = new SetUserPhotoRequest(this);
//
//            request.EmailAddress = emailAddress;
//            request.Photo = photo;
//
//            return request.Execute().Results;
//        }

/// <summary>
/// Begins an async request for a user photo
/// </summary>
/// <param name="callback">An AsyncCallback delegate</param>
/// <param name="state">An object that contains state information for this request</param>
/// <param name="emailAddress">The user's email address</param>
/// <param name="userPhotoSize">The desired size of the returned photo. Valid photo sizes are in UserPhotoSize</param>
/// <param name="entityTag">A photo's cache ID which will allow the caller to ensure their cached photo is up to date</param>
/// <returns>An IAsyncResult that references the asynchronous request.</returns>
//IAsyncResult BeginGetUserPhoto(
//            AsyncCallback callback,
//            object state,
//            string emailAddress,
//            string userPhotoSize,
//            string entityTag)
//        {
//            EwsUtilities.ValidateParam(emailAddress, "emailAddress");
//            EwsUtilities.ValidateParam(userPhotoSize, "userPhotoSize");
//            EwsUtilities.ValidateParamAllowNull(entityTag, "entityTag");
//
//            GetUserPhotoRequest request = new GetUserPhotoRequest(this);
//
//            request.EmailAddress = emailAddress;
//            request.UserPhotoSize = userPhotoSize;
//            request.EntityTag = entityTag;
//
//            return request.BeginExecute(callback, state);
//        }

/// <summary>
/// Ends an async request for a user's photo
/// </summary>
/// <param name="asyncResult">An IAsyncResult that references the asynchronous request.</param>
/// <returns>A result object containing the photo state</returns>
//GetUserPhotoResults EndGetUserPhoto(IAsyncResult asyncResult)
//        {
//            GetUserPhotoRequest request = AsyncRequestResult.ExtractServiceRequest<GetUserPhotoRequest>(this, asyncResult);
//            return request.EndExecute(asyncResult).Results;
//        }

/// <summary>
/// This method is for retreiving people insight for given email addresses
/// </summary>
/// <param name="emailAddresses">Specified eamiladdresses to retrieve</param>
/// <returns>The collection of Person objects containing the insight info</returns>
//Collection<Person> GetPeopleInsights(Iterable<string> emailAddresses)
//        {
//            GetPeopleInsightsRequest request = new GetPeopleInsightsRequest(this);
//            request.Emailaddresses.AddRange(emailAddresses);
//
//            return request.Execute().People;
//        }

/// <summary>
/// Gets an attachment.
/// </summary>
/// <param name="attachments">The attachments.</param>
/// <param name="bodyType">Type of the body.</param>
/// <param name="additionalProperties">The additional properties.</param>
/// <param name="errorHandling">Type of error handling to perform.</param>
/// <returns>Service response collection.</returns>
Future<ServiceResponseCollection<GetAttachmentResponse>>
    InternalGetAttachments(
        Iterable<Attachment> attachments,
        BodyType? bodyType,
        Iterable<PropertyDefinitionBase>? additionalProperties,
        ServiceErrorHandling errorHandling) {
  GetAttachmentRequest request =
      new GetAttachmentRequest(this, errorHandling);

  request.Attachments.addAll(attachments);
  request.BodyType = bodyType;

  if (additionalProperties != null) {
    request.AdditionalProperties.addAll(additionalProperties);
  }

  return request.Execute();
}