| | 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 Events. |
| | 22 | | /// </summary> |
| | 23 | | public static partial class EventsExtensions |
| | 24 | | { |
| | 25 | | /// <summary> |
| | 26 | | /// Post Reward. |
| | 27 | | /// </summary> |
| | 28 | | /// <remarks> |
| | 29 | | /// Report reward that resulted from using the action specified in |
| | 30 | | /// rewardActionId for the specified event. |
| | 31 | | /// </remarks> |
| | 32 | | /// <param name='operations'> |
| | 33 | | /// The operations group for this extension method. |
| | 34 | | /// </param> |
| | 35 | | /// <param name='eventId'> |
| | 36 | | /// The event id this reward applies to. |
| | 37 | | /// </param> |
| | 38 | | /// <param name='reward'> |
| | 39 | | /// The reward should be a floating point number, typically between 0 and 1. |
| | 40 | | /// </param> |
| | 41 | | public static void Reward(this IEvents operations, string eventId, RewardRequest reward) |
| | 42 | | { |
| 0 | 43 | | operations.RewardAsync(eventId, reward).GetAwaiter().GetResult(); |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// Post Reward. |
| | 48 | | /// </summary> |
| | 49 | | /// <remarks> |
| | 50 | | /// Report reward that resulted from using the action specified in |
| | 51 | | /// rewardActionId for the specified event. |
| | 52 | | /// </remarks> |
| | 53 | | /// <param name='operations'> |
| | 54 | | /// The operations group for this extension method. |
| | 55 | | /// </param> |
| | 56 | | /// <param name='eventId'> |
| | 57 | | /// The event id this reward applies to. |
| | 58 | | /// </param> |
| | 59 | | /// <param name='reward'> |
| | 60 | | /// The reward should be a floating point number, typically between 0 and 1. |
| | 61 | | /// </param> |
| | 62 | | /// <param name='cancellationToken'> |
| | 63 | | /// The cancellation token. |
| | 64 | | /// </param> |
| | 65 | | public static async Task RewardAsync(this IEvents operations, string eventId, RewardRequest reward, Cancella |
| | 66 | | { |
| 2 | 67 | | (await operations.RewardWithHttpMessagesAsync(eventId, reward, null, cancellationToken).ConfigureAwait(f |
| 2 | 68 | | } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Post Reward. |
| | 72 | | /// </summary> |
| | 73 | | /// <remarks> |
| | 74 | | /// Report reward that resulted from using the action specified in |
| | 75 | | /// rewardActionId for the specified event. |
| | 76 | | /// </remarks> |
| | 77 | | /// <param name='operations'> |
| | 78 | | /// The operations group for this extension method. |
| | 79 | | /// </param> |
| | 80 | | /// <param name='eventId'> |
| | 81 | | /// The event id this reward applies to. |
| | 82 | | /// </param> |
| | 83 | | /// <param name='reward'> |
| | 84 | | /// The reward should be a floating point number, typically between 0 and 1. |
| | 85 | | /// </param> |
| | 86 | | /// <param name='customHeaders'> |
| | 87 | | /// Headers that will be added to request. |
| | 88 | | /// </param> |
| | 89 | | public static HttpOperationResponse RewardWithHttpMessages(this IEvents operations, string eventId, RewardRe |
| | 90 | | { |
| 0 | 91 | | return operations.RewardWithHttpMessagesAsync(eventId, reward, customHeaders, CancellationToken.None).Co |
| | 92 | | } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Activate Event. |
| | 96 | | /// </summary> |
| | 97 | | /// <remarks> |
| | 98 | | /// Report that the specified event was actually displayed to the user and a |
| | 99 | | /// reward should be expected for it |
| | 100 | | /// </remarks> |
| | 101 | | /// <param name='operations'> |
| | 102 | | /// The operations group for this extension method. |
| | 103 | | /// </param> |
| | 104 | | /// <param name='eventId'> |
| | 105 | | /// The event ID this activation applies to. |
| | 106 | | /// </param> |
| | 107 | | public static void Activate(this IEvents operations, string eventId) |
| | 108 | | { |
| 0 | 109 | | operations.ActivateAsync(eventId).GetAwaiter().GetResult(); |
| 0 | 110 | | } |
| | 111 | |
|
| | 112 | | /// <summary> |
| | 113 | | /// Activate Event. |
| | 114 | | /// </summary> |
| | 115 | | /// <remarks> |
| | 116 | | /// Report that the specified event was actually displayed to the user and a |
| | 117 | | /// reward should be expected for it |
| | 118 | | /// </remarks> |
| | 119 | | /// <param name='operations'> |
| | 120 | | /// The operations group for this extension method. |
| | 121 | | /// </param> |
| | 122 | | /// <param name='eventId'> |
| | 123 | | /// The event ID this activation applies to. |
| | 124 | | /// </param> |
| | 125 | | /// <param name='cancellationToken'> |
| | 126 | | /// The cancellation token. |
| | 127 | | /// </param> |
| | 128 | | public static async Task ActivateAsync(this IEvents operations, string eventId, CancellationToken cancellati |
| | 129 | | { |
| 0 | 130 | | (await operations.ActivateWithHttpMessagesAsync(eventId, null, cancellationToken).ConfigureAwait(false)) |
| 0 | 131 | | } |
| | 132 | |
|
| | 133 | | /// <summary> |
| | 134 | | /// Activate Event. |
| | 135 | | /// </summary> |
| | 136 | | /// <remarks> |
| | 137 | | /// Report that the specified event was actually displayed to the user and a |
| | 138 | | /// reward should be expected for it |
| | 139 | | /// </remarks> |
| | 140 | | /// <param name='operations'> |
| | 141 | | /// The operations group for this extension method. |
| | 142 | | /// </param> |
| | 143 | | /// <param name='eventId'> |
| | 144 | | /// The event ID this activation applies to. |
| | 145 | | /// </param> |
| | 146 | | /// <param name='customHeaders'> |
| | 147 | | /// Headers that will be added to request. |
| | 148 | | /// </param> |
| | 149 | | public static HttpOperationResponse ActivateWithHttpMessages(this IEvents operations, string eventId, Dictio |
| | 150 | | { |
| 0 | 151 | | return operations.ActivateWithHttpMessagesAsync(eventId, customHeaders, CancellationToken.None).Configur |
| | 152 | | } |
| | 153 | |
|
| | 154 | | } |
| | 155 | | } |