/// <summary>
 /// Creates the specified Planner using POST.
 /// </summary>
 /// <param name="plannerToCreate">The Planner to create.</param>
 /// <returns>The created Planner.</returns>
 public System.Threading.Tasks.Task <Planner> CreateAsync(Planner plannerToCreate)
 {
     return(this.CreateAsync(plannerToCreate, CancellationToken.None));
 }
Exemple #2
0
        /// <summary>
        /// Initializes any collection properties after deserialization, like next requests for paging.
        /// </summary>
        /// <param name="plannerToInitialize">The <see cref="Planner"/> with the collection properties to initialize.</param>
        private void InitializeCollectionProperties(Planner plannerToInitialize)
        {
            if (plannerToInitialize != null && plannerToInitialize.AdditionalData != null)
            {
                if (plannerToInitialize.Buckets != null && plannerToInitialize.Buckets.CurrentPage != null)
                {
                    plannerToInitialize.Buckets.AdditionalData = plannerToInitialize.AdditionalData;

                    object nextPageLink;
                    plannerToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        plannerToInitialize.Buckets.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                if (plannerToInitialize.Plans != null && plannerToInitialize.Plans.CurrentPage != null)
                {
                    plannerToInitialize.Plans.AdditionalData = plannerToInitialize.AdditionalData;

                    object nextPageLink;
                    plannerToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        plannerToInitialize.Plans.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                if (plannerToInitialize.Rosters != null && plannerToInitialize.Rosters.CurrentPage != null)
                {
                    plannerToInitialize.Rosters.AdditionalData = plannerToInitialize.AdditionalData;

                    object nextPageLink;
                    plannerToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        plannerToInitialize.Rosters.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                if (plannerToInitialize.Tasks != null && plannerToInitialize.Tasks.CurrentPage != null)
                {
                    plannerToInitialize.Tasks.AdditionalData = plannerToInitialize.AdditionalData;

                    object nextPageLink;
                    plannerToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        plannerToInitialize.Tasks.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }
            }
        }