| | 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.IO; |
| | 18 | | using System.Threading; |
| | 19 | | using System.Threading.Tasks; |
| | 20 | |
|
| | 21 | | /// <summary> |
| | 22 | | /// Extension methods for Model. |
| | 23 | | /// </summary> |
| | 24 | | public static partial class ModelExtensions |
| | 25 | | { |
| | 26 | | /// <summary> |
| | 27 | | /// Get Model. |
| | 28 | | /// </summary> |
| | 29 | | /// <remarks> |
| | 30 | | /// Get the model file generated by Personalizer service. |
| | 31 | | /// </remarks> |
| | 32 | | /// <param name='operations'> |
| | 33 | | /// The operations group for this extension method. |
| | 34 | | /// </param> |
| | 35 | | public static Stream Get(this IModel operations) |
| | 36 | | { |
| 0 | 37 | | return operations.GetAsync().GetAwaiter().GetResult(); |
| | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> |
| | 41 | | /// Get Model. |
| | 42 | | /// </summary> |
| | 43 | | /// <remarks> |
| | 44 | | /// Get the model file generated by Personalizer service. |
| | 45 | | /// </remarks> |
| | 46 | | /// <param name='operations'> |
| | 47 | | /// The operations group for this extension method. |
| | 48 | | /// </param> |
| | 49 | | /// <param name='cancellationToken'> |
| | 50 | | /// The cancellation token. |
| | 51 | | /// </param> |
| | 52 | | public static async Task<Stream> GetAsync(this IModel operations, CancellationToken cancellationToken = defa |
| | 53 | | { |
| 2 | 54 | | var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false); |
| 2 | 55 | | _result.Request.Dispose(); |
| 2 | 56 | | return _result.Body; |
| 2 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Get Model. |
| | 61 | | /// </summary> |
| | 62 | | /// <remarks> |
| | 63 | | /// Get the model file generated by Personalizer service. |
| | 64 | | /// </remarks> |
| | 65 | | /// <param name='operations'> |
| | 66 | | /// The operations group for this extension method. |
| | 67 | | /// </param> |
| | 68 | | /// <param name='customHeaders'> |
| | 69 | | /// Headers that will be added to request. |
| | 70 | | /// </param> |
| | 71 | | public static HttpOperationResponse<Stream> GetWithHttpMessages(this IModel operations, Dictionary<string, L |
| | 72 | | { |
| 0 | 73 | | return operations.GetWithHttpMessagesAsync(customHeaders, CancellationToken.None).ConfigureAwait(false). |
| | 74 | | } |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Reset Model. |
| | 78 | | /// </summary> |
| | 79 | | /// <remarks> |
| | 80 | | /// Resets the model file generated by Personalizer service. |
| | 81 | | /// </remarks> |
| | 82 | | /// <param name='operations'> |
| | 83 | | /// The operations group for this extension method. |
| | 84 | | /// </param> |
| | 85 | | public static void Reset(this IModel operations) |
| | 86 | | { |
| 0 | 87 | | operations.ResetAsync().GetAwaiter().GetResult(); |
| 0 | 88 | | } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Reset Model. |
| | 92 | | /// </summary> |
| | 93 | | /// <remarks> |
| | 94 | | /// Resets the model file generated by Personalizer service. |
| | 95 | | /// </remarks> |
| | 96 | | /// <param name='operations'> |
| | 97 | | /// The operations group for this extension method. |
| | 98 | | /// </param> |
| | 99 | | /// <param name='cancellationToken'> |
| | 100 | | /// The cancellation token. |
| | 101 | | /// </param> |
| | 102 | | public static async Task ResetAsync(this IModel operations, CancellationToken cancellationToken = default(Ca |
| | 103 | | { |
| 2 | 104 | | (await operations.ResetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose(); |
| 2 | 105 | | } |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// Reset Model. |
| | 109 | | /// </summary> |
| | 110 | | /// <remarks> |
| | 111 | | /// Resets the model file generated by Personalizer service. |
| | 112 | | /// </remarks> |
| | 113 | | /// <param name='operations'> |
| | 114 | | /// The operations group for this extension method. |
| | 115 | | /// </param> |
| | 116 | | /// <param name='customHeaders'> |
| | 117 | | /// Headers that will be added to request. |
| | 118 | | /// </param> |
| | 119 | | public static HttpOperationResponse ResetWithHttpMessages(this IModel operations, Dictionary<string, List<st |
| | 120 | | { |
| 0 | 121 | | return operations.ResetWithHttpMessagesAsync(customHeaders, CancellationToken.None).ConfigureAwait(false |
| | 122 | | } |
| | 123 | |
|
| | 124 | | /// <summary> |
| | 125 | | /// Get Model Properties. |
| | 126 | | /// </summary> |
| | 127 | | /// <remarks> |
| | 128 | | /// Get properties of the model file generated by Personalizer service. |
| | 129 | | /// </remarks> |
| | 130 | | /// <param name='operations'> |
| | 131 | | /// The operations group for this extension method. |
| | 132 | | /// </param> |
| | 133 | | public static ModelProperties GetProperties(this IModel operations) |
| | 134 | | { |
| 0 | 135 | | return operations.GetPropertiesAsync().GetAwaiter().GetResult(); |
| | 136 | | } |
| | 137 | |
|
| | 138 | | /// <summary> |
| | 139 | | /// Get Model Properties. |
| | 140 | | /// </summary> |
| | 141 | | /// <remarks> |
| | 142 | | /// Get properties of the model file generated by Personalizer service. |
| | 143 | | /// </remarks> |
| | 144 | | /// <param name='operations'> |
| | 145 | | /// The operations group for this extension method. |
| | 146 | | /// </param> |
| | 147 | | /// <param name='cancellationToken'> |
| | 148 | | /// The cancellation token. |
| | 149 | | /// </param> |
| | 150 | | public static async Task<ModelProperties> GetPropertiesAsync(this IModel operations, CancellationToken cance |
| | 151 | | { |
| 2 | 152 | | using (var _result = await operations.GetPropertiesWithHttpMessagesAsync(null, cancellationToken).Config |
| | 153 | | { |
| 2 | 154 | | return _result.Body; |
| | 155 | | } |
| 2 | 156 | | } |
| | 157 | |
|
| | 158 | | /// <summary> |
| | 159 | | /// Get Model Properties. |
| | 160 | | /// </summary> |
| | 161 | | /// <remarks> |
| | 162 | | /// Get properties of the model file generated by Personalizer service. |
| | 163 | | /// </remarks> |
| | 164 | | /// <param name='operations'> |
| | 165 | | /// The operations group for this extension method. |
| | 166 | | /// </param> |
| | 167 | | /// <param name='customHeaders'> |
| | 168 | | /// Headers that will be added to request. |
| | 169 | | /// </param> |
| | 170 | | public static HttpOperationResponse<ModelProperties> GetPropertiesWithHttpMessages(this IModel operations, D |
| | 171 | | { |
| 0 | 172 | | return operations.GetPropertiesWithHttpMessagesAsync(customHeaders, CancellationToken.None).ConfigureAwa |
| | 173 | | } |
| | 174 | |
|
| | 175 | | } |
| | 176 | | } |