/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="policySetToInitialize">The <see cref="PolicySet"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(PolicySet policySetToInitialize) { if (policySetToInitialize != null && policySetToInitialize.AdditionalData != null) { if (policySetToInitialize.Assignments != null && policySetToInitialize.Assignments.CurrentPage != null) { policySetToInitialize.Assignments.AdditionalData = policySetToInitialize.AdditionalData; object nextPageLink; policySetToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink); var nextPageLinkString = nextPageLink as string; if (!string.IsNullOrEmpty(nextPageLinkString)) { policySetToInitialize.Assignments.InitializeNextPageRequest( this.Client, nextPageLinkString); } } if (policySetToInitialize.Items != null && policySetToInitialize.Items.CurrentPage != null) { policySetToInitialize.Items.AdditionalData = policySetToInitialize.AdditionalData; object nextPageLink; policySetToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink); var nextPageLinkString = nextPageLink as string; if (!string.IsNullOrEmpty(nextPageLinkString)) { policySetToInitialize.Items.InitializeNextPageRequest( this.Client, nextPageLinkString); } } } }
/// <summary> /// Creates the specified PolicySet using POST. /// </summary> /// <param name="policySetToCreate">The PolicySet to create.</param> /// <returns>The created PolicySet.</returns> public System.Threading.Tasks.Task <PolicySet> CreateAsync(PolicySet policySetToCreate) { return(this.CreateAsync(policySetToCreate, CancellationToken.None)); }
/// <summary> /// Adds the specified PolicySet to the collection via POST. /// </summary> /// <param name="policySet">The PolicySet to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created PolicySet.</returns> public System.Threading.Tasks.Task <PolicySet> AddAsync(PolicySet policySet, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <PolicySet>(policySet, cancellationToken)); }
/// <summary> /// Adds the specified PolicySet to the collection via POST. /// </summary> /// <param name="policySet">The PolicySet to add.</param> /// <returns>The created PolicySet.</returns> public System.Threading.Tasks.Task <PolicySet> AddAsync(PolicySet policySet) { return(this.AddAsync(policySet, CancellationToken.None)); }