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

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Esempio n. 4
0
 /// <summary>
 /// Creates the specified AndroidForWorkAppConfigurationSchema using POST.
 /// </summary>
 /// <param name="androidForWorkAppConfigurationSchemaToCreate">The AndroidForWorkAppConfigurationSchema to create.</param>
 /// <returns>The created AndroidForWorkAppConfigurationSchema.</returns>
 public System.Threading.Tasks.Task <AndroidForWorkAppConfigurationSchema> CreateAsync(AndroidForWorkAppConfigurationSchema androidForWorkAppConfigurationSchemaToCreate)
 {
     return(this.CreateAsync(androidForWorkAppConfigurationSchemaToCreate, CancellationToken.None));
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="androidForWorkAppConfigurationSchemaToInitialize">The <see cref="AndroidForWorkAppConfigurationSchema"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(AndroidForWorkAppConfigurationSchema androidForWorkAppConfigurationSchemaToInitialize)
 {
 }
Esempio n. 6
0
        /// <summary>
        /// Updates the specified AndroidForWorkAppConfigurationSchema using PATCH.
        /// </summary>
        /// <param name="androidForWorkAppConfigurationSchemaToUpdate">The AndroidForWorkAppConfigurationSchema 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 AndroidForWorkAppConfigurationSchema.</returns>
        public async System.Threading.Tasks.Task <AndroidForWorkAppConfigurationSchema> UpdateAsync(AndroidForWorkAppConfigurationSchema androidForWorkAppConfigurationSchemaToUpdate, CancellationToken cancellationToken)
        {
            if (androidForWorkAppConfigurationSchemaToUpdate.AdditionalData != null)
            {
                if (androidForWorkAppConfigurationSchemaToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    androidForWorkAppConfigurationSchemaToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, androidForWorkAppConfigurationSchemaToUpdate.GetType().Name)
                    });
                }
            }
            if (androidForWorkAppConfigurationSchemaToUpdate.AdditionalData != null)
            {
                if (androidForWorkAppConfigurationSchemaToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    androidForWorkAppConfigurationSchemaToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, androidForWorkAppConfigurationSchemaToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <AndroidForWorkAppConfigurationSchema>(androidForWorkAppConfigurationSchemaToUpdate, cancellationToken).ConfigureAwait(false);

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