コード例 #1
0
 /// <summary>
 /// Fetches a single chart item from the organization chart.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// GET /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685?uniqueId=111-222
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart which the item belongs to
 /// </param>
 /// <param name='uniqueId'>
 /// Id of the item to return
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <JsonChartItemViewModel> GetChartItemAsync(this IChartDataApi operations, string chartId, string uniqueId, string version, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetChartItemWithHttpMessagesAsync(chartId, uniqueId, version, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Fetches chart data in a hierarchical view.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// GET /api/v1/data/chartview/53bec490-1cdc-42f5-8983-e6efe66dc685
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='startValue'>
 /// The unique Id to begin fetching from
 /// </param>
 /// <param name='depth'>
 /// The number of levels of the organization chart to process
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ChartDataView> GetChartViewAsync(this IChartDataApi operations, string chartId, string version, string startValue = default(string), int?depth = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetChartViewWithHttpMessagesAsync(chartId, version, startValue, depth, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #3
0
 /// <summary>
 /// Fetches all the items in the organization chart.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// GET /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart
 /// </param>
 /// <param name='version'>
 /// </param>
 public static IList <JsonChartItemViewModel> GetChartItems(this IChartDataApi operations, string chartId, string version)
 {
     return(operations.GetChartItemsAsync(chartId, version).GetAwaiter().GetResult());
 }
コード例 #4
0
 /// <summary>
 /// Fetches chart data in a hierarchical view.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// GET /api/v1/data/chartview/53bec490-1cdc-42f5-8983-e6efe66dc685
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='startValue'>
 /// The unique Id to begin fetching from
 /// </param>
 /// <param name='depth'>
 /// The number of levels of the organization chart to process
 /// </param>
 public static ChartDataView GetChartView(this IChartDataApi operations, string chartId, string version, string startValue = default(string), int?depth = default(int?))
 {
     return(operations.GetChartViewAsync(chartId, version, startValue, depth).GetAwaiter().GetResult());
 }
コード例 #5
0
 /// <summary>
 /// Fetches a single chart item from the organization chart.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// GET /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685?uniqueId=111-222
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart which the item belongs to
 /// </param>
 /// <param name='uniqueId'>
 /// Id of the item to return
 /// </param>
 /// <param name='version'>
 /// </param>
 public static JsonChartItemViewModel GetChartItem(this IChartDataApi operations, string chartId, string uniqueId, string version)
 {
     return(operations.GetChartItemAsync(chartId, uniqueId, version).GetAwaiter().GetResult());
 }
コード例 #6
0
 /// <summary>
 /// Uploads a list of chart items and creates them within the chart.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// POST /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685/bulk
 /// [{
 /// "UniqueId": "2",
 /// "ManagerId": "1",
 /// "DisplayName": "Mike Smith",
 /// "Title": "CTO"
 /// },
 /// {
 /// "UniqueId": "3",
 /// "ManagerId": "1",
 /// "DisplayName": "Jane Doe",
 /// "Title": "CFO"
 /// }]
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of the chart in the item will be created
 /// </param>
 /// <param name='items'>
 /// List of item objects
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <JsonChartItemViewModel> > CreateChartItemsAsync(this IChartDataApi operations, string chartId, IList <object> items, string version, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateChartItemsWithHttpMessagesAsync(chartId, items, version, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #7
0
 /// <summary>
 /// Delete a chart item from an organization chart
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// DELETE /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685?uniqueId=111-222
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart that contains the item
 /// </param>
 /// <param name='uniqueId'>
 /// Id of the item to remove from the chart
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteChartItemAsync(this IChartDataApi operations, string chartId, string uniqueId, string version, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteChartItemWithHttpMessagesAsync(chartId, uniqueId, version, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #8
0
 /// <summary>
 /// Delete a chart item from an organization chart
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// Sample request:
 ///
 /// DELETE /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685?uniqueId=111-222
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of chart that contains the item
 /// </param>
 /// <param name='uniqueId'>
 /// Id of the item to remove from the chart
 /// </param>
 /// <param name='version'>
 /// </param>
 public static void DeleteChartItem(this IChartDataApi operations, string chartId, string uniqueId, string version)
 {
     operations.DeleteChartItemAsync(chartId, uniqueId, version).GetAwaiter().GetResult();
 }
コード例 #9
0
 /// <summary>
 /// Creates a single chart item in an organization chart.
 /// </summary>
 /// <remarks>
 /// &lt;b&gt;Please note&lt;/b&gt; Only charts created via the API or by
 /// uploading a spreadsheet are supported in this version of the API.&lt;br
 /// /&gt;
 /// The data must contain a &lt;b&gt;Unqiue Id&lt;/b&gt; and &lt;b&gt;Manager
 /// Id&lt;/b&gt; other can be added as required for example
 /// &lt;b&gt;DisplayName&lt;/b&gt; or &lt;b&gt;Email&lt;/b&gt;
 /// Sample request:
 ///
 /// POST /api/v1/data/53bec490-1cdc-42f5-8983-e6efe66dc685/
 /// [{
 /// "UniqueId": "2",
 /// "ManagerId": "1",
 /// "DisplayName": "Mike Smith",
 /// "Title": "CTO"
 /// }]
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='chartId'>
 /// Id of the chart in which the item will be created
 /// </param>
 /// <param name='model'>
 /// JSON model of the item to be created.
 /// </param>
 /// <param name='version'>
 /// </param>
 public static JsonChartItemViewModel CreateChartItem(this IChartDataApi operations, string chartId, object model, string version)
 {
     return(operations.CreateChartItemAsync(chartId, model, version).GetAwaiter().GetResult());
 }