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

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

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