Example #1
0
        /// <summary>
        /// Updates the specified TenantSetupInfo using PATCH.
        /// </summary>
        /// <param name="tenantSetupInfoToUpdate">The TenantSetupInfo 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 TenantSetupInfo.</returns>
        public async System.Threading.Tasks.Task <TenantSetupInfo> UpdateAsync(TenantSetupInfo tenantSetupInfoToUpdate, CancellationToken cancellationToken)
        {
            if (tenantSetupInfoToUpdate.AdditionalData != null)
            {
                if (tenantSetupInfoToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    tenantSetupInfoToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, tenantSetupInfoToUpdate.GetType().Name)
                    });
                }
            }
            if (tenantSetupInfoToUpdate.AdditionalData != null)
            {
                if (tenantSetupInfoToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    tenantSetupInfoToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, tenantSetupInfoToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <TenantSetupInfo>(tenantSetupInfoToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
 /// <summary>
 /// Constructs a new <see cref="PrivilegedSignupStatusCompleteSetupRequestBuilder"/>.
 /// </summary>
 /// <param name="requestUrl">The URL for the request.</param>
 /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
 /// <param name="tenantSetupInfo">A tenantSetupInfo parameter for the OData method call.</param>
 public PrivilegedSignupStatusCompleteSetupRequestBuilder(
     string requestUrl,
     IBaseClient client,
     TenantSetupInfo tenantSetupInfo)
     : base(requestUrl, client)
 {
     this.SetParameter("tenantSetupInfo", tenantSetupInfo, true);
 }
 /// <summary>
 /// Gets the request builder for PrivilegedSignupStatusCompleteSetup.
 /// </summary>
 /// <returns>The <see cref="IPrivilegedSignupStatusCompleteSetupRequestBuilder"/>.</returns>
 public IPrivilegedSignupStatusCompleteSetupRequestBuilder CompleteSetup(
     TenantSetupInfo tenantSetupInfo = null)
 {
     return(new PrivilegedSignupStatusCompleteSetupRequestBuilder(
                this.AppendSegmentToRequestUrl("microsoft.graph.completeSetup"),
                this.Client,
                tenantSetupInfo));
 }
Example #4
0
        /// <summary>
        /// Creates the specified TenantSetupInfo using POST.
        /// </summary>
        /// <param name="tenantSetupInfoToCreate">The TenantSetupInfo to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created TenantSetupInfo.</returns>
        public async System.Threading.Tasks.Task <TenantSetupInfo> CreateAsync(TenantSetupInfo tenantSetupInfoToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <TenantSetupInfo>(tenantSetupInfoToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Example #5
0
 /// <summary>
 /// Creates the specified TenantSetupInfo using POST.
 /// </summary>
 /// <param name="tenantSetupInfoToCreate">The TenantSetupInfo to create.</param>
 /// <returns>The created TenantSetupInfo.</returns>
 public System.Threading.Tasks.Task <TenantSetupInfo> CreateAsync(TenantSetupInfo tenantSetupInfoToCreate)
 {
     return(this.CreateAsync(tenantSetupInfoToCreate, CancellationToken.None));
 }
Example #6
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="tenantSetupInfoToInitialize">The <see cref="TenantSetupInfo"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(TenantSetupInfo tenantSetupInfoToInitialize)
 {
 }