Beispiel #1
0
 /// <summary>
 /// Adds the specified UnifiedRoleEligibilityRequestObject to the collection via POST.
 /// </summary>
 /// <param name="unifiedRoleEligibilityRequest">The UnifiedRoleEligibilityRequestObject to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created UnifiedRoleEligibilityRequestObject.</returns>
 public System.Threading.Tasks.Task <UnifiedRoleEligibilityRequestObject> AddAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequest, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <UnifiedRoleEligibilityRequestObject>(unifiedRoleEligibilityRequest, cancellationToken));
 }
Beispiel #2
0
        /// <summary>
        /// Creates the specified UnifiedRoleEligibilityRequestObject using POST.
        /// </summary>
        /// <param name="unifiedRoleEligibilityRequestObjectToCreate">The UnifiedRoleEligibilityRequestObject to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created UnifiedRoleEligibilityRequestObject.</returns>
        public async System.Threading.Tasks.Task <UnifiedRoleEligibilityRequestObject> CreateAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequestObjectToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <UnifiedRoleEligibilityRequestObject>(unifiedRoleEligibilityRequestObjectToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Beispiel #3
0
 /// <summary>
 /// Adds the specified UnifiedRoleEligibilityRequestObject to the collection via POST.
 /// </summary>
 /// <param name="unifiedRoleEligibilityRequest">The UnifiedRoleEligibilityRequestObject to add.</param>
 /// <returns>The created UnifiedRoleEligibilityRequestObject.</returns>
 public System.Threading.Tasks.Task <UnifiedRoleEligibilityRequestObject> AddAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequest)
 {
     return(this.AddAsync(unifiedRoleEligibilityRequest, CancellationToken.None));
 }
Beispiel #4
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="unifiedRoleEligibilityRequestObjectToInitialize">The <see cref="UnifiedRoleEligibilityRequestObject"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequestObjectToInitialize)
 {
 }
Beispiel #5
0
        /// <summary>
        /// Updates the specified UnifiedRoleEligibilityRequestObject using PATCH.
        /// </summary>
        /// <param name="unifiedRoleEligibilityRequestObjectToUpdate">The UnifiedRoleEligibilityRequestObject to update.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>
        /// <returns>The updated UnifiedRoleEligibilityRequestObject.</returns>
        public async System.Threading.Tasks.Task <UnifiedRoleEligibilityRequestObject> UpdateAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequestObjectToUpdate, CancellationToken cancellationToken)
        {
            if (unifiedRoleEligibilityRequestObjectToUpdate.AdditionalData != null)
            {
                if (unifiedRoleEligibilityRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    unifiedRoleEligibilityRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, unifiedRoleEligibilityRequestObjectToUpdate.GetType().Name)
                    });
                }
            }
            if (unifiedRoleEligibilityRequestObjectToUpdate.AdditionalData != null)
            {
                if (unifiedRoleEligibilityRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    unifiedRoleEligibilityRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, unifiedRoleEligibilityRequestObjectToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <UnifiedRoleEligibilityRequestObject>(unifiedRoleEligibilityRequestObjectToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Beispiel #6
0
 /// <summary>
 /// Updates the specified UnifiedRoleEligibilityRequestObject using PATCH.
 /// </summary>
 /// <param name="unifiedRoleEligibilityRequestObjectToUpdate">The UnifiedRoleEligibilityRequestObject to update.</param>
 /// <returns>The updated UnifiedRoleEligibilityRequestObject.</returns>
 public System.Threading.Tasks.Task <UnifiedRoleEligibilityRequestObject> UpdateAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequestObjectToUpdate)
 {
     return(this.UpdateAsync(unifiedRoleEligibilityRequestObjectToUpdate, CancellationToken.None));
 }
 /// <summary>
 /// Creates the specified UnifiedRoleEligibilityRequestObject using POST and returns a <see cref="GraphResponse{UnifiedRoleEligibilityRequestObject}"/> object.
 /// </summary>
 /// <param name="unifiedRoleEligibilityRequestObjectToCreate">The UnifiedRoleEligibilityRequestObject to create.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The <see cref="GraphResponse{UnifiedRoleEligibilityRequestObject}"/> object of the request.</returns>
 public System.Threading.Tasks.Task <GraphResponse <UnifiedRoleEligibilityRequestObject> > CreateResponseAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequestObjectToCreate, CancellationToken cancellationToken = default)
 {
     this.ContentType = CoreConstants.MimeTypeNames.Application.Json;
     this.Method      = HttpMethods.POST;
     return(this.SendAsyncWithGraphResponse <UnifiedRoleEligibilityRequestObject>(unifiedRoleEligibilityRequestObjectToCreate, cancellationToken));
 }
        /// <summary>
        /// Creates the specified UnifiedRoleEligibilityRequestObject using POST.
        /// </summary>
        /// <param name="unifiedRoleEligibilityRequestObjectToCreate">The UnifiedRoleEligibilityRequestObject to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created UnifiedRoleEligibilityRequestObject.</returns>
        public async System.Threading.Tasks.Task <UnifiedRoleEligibilityRequestObject> CreateAsync(UnifiedRoleEligibilityRequestObject unifiedRoleEligibilityRequestObjectToCreate, CancellationToken cancellationToken = default)
        {
            this.ContentType = CoreConstants.MimeTypeNames.Application.Json;
            this.Method      = HttpMethods.POST;
            var newEntity = await this.SendAsync <UnifiedRoleEligibilityRequestObject>(unifiedRoleEligibilityRequestObjectToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }