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

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
 /// <summary>
 /// Adds the specified UserScopeTeamsAppInstallation to the collection via POST.
 /// </summary>
 /// <param name="userScopeTeamsAppInstallation">The UserScopeTeamsAppInstallation to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created UserScopeTeamsAppInstallation.</returns>
 public System.Threading.Tasks.Task <UserScopeTeamsAppInstallation> AddAsync(UserScopeTeamsAppInstallation userScopeTeamsAppInstallation, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <UserScopeTeamsAppInstallation>(userScopeTeamsAppInstallation, cancellationToken));
 }
 /// <summary>
 /// Adds the specified UserScopeTeamsAppInstallation to the collection via POST.
 /// </summary>
 /// <param name="userScopeTeamsAppInstallation">The UserScopeTeamsAppInstallation to add.</param>
 /// <returns>The created UserScopeTeamsAppInstallation.</returns>
 public System.Threading.Tasks.Task <UserScopeTeamsAppInstallation> AddAsync(UserScopeTeamsAppInstallation userScopeTeamsAppInstallation)
 {
     return(this.AddAsync(userScopeTeamsAppInstallation, CancellationToken.None));
 }