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

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

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