示例#1
0
        /// <summary>
        /// Creates the specified MobileAppProvisioningConfigGroupAssignment using POST.
        /// </summary>
        /// <param name="mobileAppProvisioningConfigGroupAssignmentToCreate">The MobileAppProvisioningConfigGroupAssignment to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created MobileAppProvisioningConfigGroupAssignment.</returns>
        public async System.Threading.Tasks.Task <MobileAppProvisioningConfigGroupAssignment> CreateAsync(MobileAppProvisioningConfigGroupAssignment mobileAppProvisioningConfigGroupAssignmentToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <MobileAppProvisioningConfigGroupAssignment>(mobileAppProvisioningConfigGroupAssignmentToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
示例#2
0
 /// <summary>
 /// Creates the specified MobileAppProvisioningConfigGroupAssignment using POST.
 /// </summary>
 /// <param name="mobileAppProvisioningConfigGroupAssignmentToCreate">The MobileAppProvisioningConfigGroupAssignment to create.</param>
 /// <returns>The created MobileAppProvisioningConfigGroupAssignment.</returns>
 public System.Threading.Tasks.Task <MobileAppProvisioningConfigGroupAssignment> CreateAsync(MobileAppProvisioningConfigGroupAssignment mobileAppProvisioningConfigGroupAssignmentToCreate)
 {
     return(this.CreateAsync(mobileAppProvisioningConfigGroupAssignmentToCreate, CancellationToken.None));
 }
示例#3
0
        /// <summary>
        /// Updates the specified MobileAppProvisioningConfigGroupAssignment using PATCH.
        /// </summary>
        /// <param name="mobileAppProvisioningConfigGroupAssignmentToUpdate">The MobileAppProvisioningConfigGroupAssignment 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 MobileAppProvisioningConfigGroupAssignment.</returns>
        public async System.Threading.Tasks.Task <MobileAppProvisioningConfigGroupAssignment> UpdateAsync(MobileAppProvisioningConfigGroupAssignment mobileAppProvisioningConfigGroupAssignmentToUpdate, CancellationToken cancellationToken)
        {
            if (mobileAppProvisioningConfigGroupAssignmentToUpdate.AdditionalData != null)
            {
                if (mobileAppProvisioningConfigGroupAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    mobileAppProvisioningConfigGroupAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, mobileAppProvisioningConfigGroupAssignmentToUpdate.GetType().Name)
                    });
                }
            }
            if (mobileAppProvisioningConfigGroupAssignmentToUpdate.AdditionalData != null)
            {
                if (mobileAppProvisioningConfigGroupAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    mobileAppProvisioningConfigGroupAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, mobileAppProvisioningConfigGroupAssignmentToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <MobileAppProvisioningConfigGroupAssignment>(mobileAppProvisioningConfigGroupAssignmentToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
示例#4
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="mobileAppProvisioningConfigGroupAssignmentToInitialize">The <see cref="MobileAppProvisioningConfigGroupAssignment"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(MobileAppProvisioningConfigGroupAssignment mobileAppProvisioningConfigGroupAssignmentToInitialize)
 {
 }
 /// <summary>
 /// Adds the specified MobileAppProvisioningConfigGroupAssignment to the collection via POST.
 /// </summary>
 /// <param name="mobileAppProvisioningConfigGroupAssignment">The MobileAppProvisioningConfigGroupAssignment to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created MobileAppProvisioningConfigGroupAssignment.</returns>
 public System.Threading.Tasks.Task <MobileAppProvisioningConfigGroupAssignment> AddAsync(MobileAppProvisioningConfigGroupAssignment mobileAppProvisioningConfigGroupAssignment, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <MobileAppProvisioningConfigGroupAssignment>(mobileAppProvisioningConfigGroupAssignment, cancellationToken));
 }