| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.CognitiveServices.Personalizer |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Models; |
| | 15 | | using System.Collections; |
| | 16 | | using System.Collections.Generic; |
| | 17 | | using System.Threading; |
| | 18 | | using System.Threading.Tasks; |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Extension methods for Evaluations. |
| | 22 | | /// </summary> |
| | 23 | | public static partial class EvaluationsExtensions |
| | 24 | | { |
| | 25 | | /// <summary> |
| | 26 | | /// Get Evaluation. |
| | 27 | | /// </summary> |
| | 28 | | /// <remarks> |
| | 29 | | /// Get the evaluation associated with the Id. |
| | 30 | | /// </remarks> |
| | 31 | | /// <param name='operations'> |
| | 32 | | /// The operations group for this extension method. |
| | 33 | | /// </param> |
| | 34 | | /// <param name='evaluationId'> |
| | 35 | | /// Id of the evaluation. |
| | 36 | | /// </param> |
| | 37 | | public static Evaluation Get(this IEvaluations operations, string evaluationId) |
| | 38 | | { |
| 2 | 39 | | return operations.GetAsync(evaluationId).GetAwaiter().GetResult(); |
| | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Get Evaluation. |
| | 44 | | /// </summary> |
| | 45 | | /// <remarks> |
| | 46 | | /// Get the evaluation associated with the Id. |
| | 47 | | /// </remarks> |
| | 48 | | /// <param name='operations'> |
| | 49 | | /// The operations group for this extension method. |
| | 50 | | /// </param> |
| | 51 | | /// <param name='evaluationId'> |
| | 52 | | /// Id of the evaluation. |
| | 53 | | /// </param> |
| | 54 | | /// <param name='cancellationToken'> |
| | 55 | | /// The cancellation token. |
| | 56 | | /// </param> |
| | 57 | | public static async Task<Evaluation> GetAsync(this IEvaluations operations, string evaluationId, Cancellatio |
| | 58 | | { |
| 2 | 59 | | using (var _result = await operations.GetWithHttpMessagesAsync(evaluationId, null, cancellationToken).Co |
| | 60 | | { |
| 2 | 61 | | return _result.Body; |
| | 62 | | } |
| 2 | 63 | | } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Get Evaluation. |
| | 67 | | /// </summary> |
| | 68 | | /// <remarks> |
| | 69 | | /// Get the evaluation associated with the Id. |
| | 70 | | /// </remarks> |
| | 71 | | /// <param name='operations'> |
| | 72 | | /// The operations group for this extension method. |
| | 73 | | /// </param> |
| | 74 | | /// <param name='evaluationId'> |
| | 75 | | /// Id of the evaluation. |
| | 76 | | /// </param> |
| | 77 | | /// <param name='customHeaders'> |
| | 78 | | /// Headers that will be added to request. |
| | 79 | | /// </param> |
| | 80 | | public static HttpOperationResponse<Evaluation> GetWithHttpMessages(this IEvaluations operations, string eva |
| | 81 | | { |
| 0 | 82 | | return operations.GetWithHttpMessagesAsync(evaluationId, customHeaders, CancellationToken.None).Configur |
| | 83 | | } |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// Delete Evaluation. |
| | 87 | | /// </summary> |
| | 88 | | /// <remarks> |
| | 89 | | /// Delete the evaluation associated with the Id. |
| | 90 | | /// </remarks> |
| | 91 | | /// <param name='operations'> |
| | 92 | | /// The operations group for this extension method. |
| | 93 | | /// </param> |
| | 94 | | /// <param name='evaluationId'> |
| | 95 | | /// Id of the evaluation to delete. |
| | 96 | | /// </param> |
| | 97 | | public static void Delete(this IEvaluations operations, string evaluationId) |
| | 98 | | { |
| 2 | 99 | | operations.DeleteAsync(evaluationId).GetAwaiter().GetResult(); |
| 2 | 100 | | } |
| | 101 | |
|
| | 102 | | /// <summary> |
| | 103 | | /// Delete Evaluation. |
| | 104 | | /// </summary> |
| | 105 | | /// <remarks> |
| | 106 | | /// Delete the evaluation associated with the Id. |
| | 107 | | /// </remarks> |
| | 108 | | /// <param name='operations'> |
| | 109 | | /// The operations group for this extension method. |
| | 110 | | /// </param> |
| | 111 | | /// <param name='evaluationId'> |
| | 112 | | /// Id of the evaluation to delete. |
| | 113 | | /// </param> |
| | 114 | | /// <param name='cancellationToken'> |
| | 115 | | /// The cancellation token. |
| | 116 | | /// </param> |
| | 117 | | public static async Task DeleteAsync(this IEvaluations operations, string evaluationId, CancellationToken ca |
| | 118 | | { |
| 2 | 119 | | (await operations.DeleteWithHttpMessagesAsync(evaluationId, null, cancellationToken).ConfigureAwait(fals |
| 2 | 120 | | } |
| | 121 | |
|
| | 122 | | /// <summary> |
| | 123 | | /// Delete Evaluation. |
| | 124 | | /// </summary> |
| | 125 | | /// <remarks> |
| | 126 | | /// Delete the evaluation associated with the Id. |
| | 127 | | /// </remarks> |
| | 128 | | /// <param name='operations'> |
| | 129 | | /// The operations group for this extension method. |
| | 130 | | /// </param> |
| | 131 | | /// <param name='evaluationId'> |
| | 132 | | /// Id of the evaluation to delete. |
| | 133 | | /// </param> |
| | 134 | | /// <param name='customHeaders'> |
| | 135 | | /// Headers that will be added to request. |
| | 136 | | /// </param> |
| | 137 | | public static HttpOperationResponse DeleteWithHttpMessages(this IEvaluations operations, string evaluationId |
| | 138 | | { |
| 0 | 139 | | return operations.DeleteWithHttpMessagesAsync(evaluationId, customHeaders, CancellationToken.None).Confi |
| | 140 | | } |
| | 141 | |
|
| | 142 | | /// <summary> |
| | 143 | | /// List Evaluations. |
| | 144 | | /// </summary> |
| | 145 | | /// <remarks> |
| | 146 | | /// List all the submitted evaluations. |
| | 147 | | /// </remarks> |
| | 148 | | /// <param name='operations'> |
| | 149 | | /// The operations group for this extension method. |
| | 150 | | /// </param> |
| | 151 | | public static IList<Evaluation> List(this IEvaluations operations) |
| | 152 | | { |
| 2 | 153 | | return operations.ListAsync().GetAwaiter().GetResult(); |
| | 154 | | } |
| | 155 | |
|
| | 156 | | /// <summary> |
| | 157 | | /// List Evaluations. |
| | 158 | | /// </summary> |
| | 159 | | /// <remarks> |
| | 160 | | /// List all the submitted evaluations. |
| | 161 | | /// </remarks> |
| | 162 | | /// <param name='operations'> |
| | 163 | | /// The operations group for this extension method. |
| | 164 | | /// </param> |
| | 165 | | /// <param name='cancellationToken'> |
| | 166 | | /// The cancellation token. |
| | 167 | | /// </param> |
| | 168 | | public static async Task<IList<Evaluation>> ListAsync(this IEvaluations operations, CancellationToken cancel |
| | 169 | | { |
| 2 | 170 | | using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait( |
| | 171 | | { |
| 2 | 172 | | return _result.Body; |
| | 173 | | } |
| 2 | 174 | | } |
| | 175 | |
|
| | 176 | | /// <summary> |
| | 177 | | /// List Evaluations. |
| | 178 | | /// </summary> |
| | 179 | | /// <remarks> |
| | 180 | | /// List all the submitted evaluations. |
| | 181 | | /// </remarks> |
| | 182 | | /// <param name='operations'> |
| | 183 | | /// The operations group for this extension method. |
| | 184 | | /// </param> |
| | 185 | | /// <param name='customHeaders'> |
| | 186 | | /// Headers that will be added to request. |
| | 187 | | /// </param> |
| | 188 | | public static HttpOperationResponse<IList<Evaluation>> ListWithHttpMessages(this IEvaluations operations, Di |
| | 189 | | { |
| 0 | 190 | | return operations.ListWithHttpMessagesAsync(customHeaders, CancellationToken.None).ConfigureAwait(false) |
| | 191 | | } |
| | 192 | |
|
| | 193 | | /// <summary> |
| | 194 | | /// Create Evaluation. |
| | 195 | | /// </summary> |
| | 196 | | /// <remarks> |
| | 197 | | /// Submit a new evaluation job. |
| | 198 | | /// </remarks> |
| | 199 | | /// <param name='operations'> |
| | 200 | | /// The operations group for this extension method. |
| | 201 | | /// </param> |
| | 202 | | /// <param name='evaluation'> |
| | 203 | | /// The evaluation job definition. |
| | 204 | | /// </param> |
| | 205 | | public static Evaluation Create(this IEvaluations operations, EvaluationContract evaluation) |
| | 206 | | { |
| 2 | 207 | | return operations.CreateAsync(evaluation).GetAwaiter().GetResult(); |
| | 208 | | } |
| | 209 | |
|
| | 210 | | /// <summary> |
| | 211 | | /// Create Evaluation. |
| | 212 | | /// </summary> |
| | 213 | | /// <remarks> |
| | 214 | | /// Submit a new evaluation job. |
| | 215 | | /// </remarks> |
| | 216 | | /// <param name='operations'> |
| | 217 | | /// The operations group for this extension method. |
| | 218 | | /// </param> |
| | 219 | | /// <param name='evaluation'> |
| | 220 | | /// The evaluation job definition. |
| | 221 | | /// </param> |
| | 222 | | /// <param name='cancellationToken'> |
| | 223 | | /// The cancellation token. |
| | 224 | | /// </param> |
| | 225 | | public static async Task<Evaluation> CreateAsync(this IEvaluations operations, EvaluationContract evaluation |
| | 226 | | { |
| 2 | 227 | | using (var _result = await operations.CreateWithHttpMessagesAsync(evaluation, null, cancellationToken).C |
| | 228 | | { |
| 2 | 229 | | return _result.Body; |
| | 230 | | } |
| 2 | 231 | | } |
| | 232 | |
|
| | 233 | | /// <summary> |
| | 234 | | /// Create Evaluation. |
| | 235 | | /// </summary> |
| | 236 | | /// <remarks> |
| | 237 | | /// Submit a new evaluation job. |
| | 238 | | /// </remarks> |
| | 239 | | /// <param name='operations'> |
| | 240 | | /// The operations group for this extension method. |
| | 241 | | /// </param> |
| | 242 | | /// <param name='evaluation'> |
| | 243 | | /// The evaluation job definition. |
| | 244 | | /// </param> |
| | 245 | | /// <param name='customHeaders'> |
| | 246 | | /// Headers that will be added to request. |
| | 247 | | /// </param> |
| | 248 | | public static HttpOperationResponse<Evaluation,EvaluationsCreateHeaders> CreateWithHttpMessages(this IEvalua |
| | 249 | | { |
| 0 | 250 | | return operations.CreateWithHttpMessagesAsync(evaluation, customHeaders, CancellationToken.None).Configu |
| | 251 | | } |
| | 252 | |
|
| | 253 | | } |
| | 254 | | } |