/ src / common / AllExperiments / Microsoft.VariantAssignment / Contract / IVariantAssignmentResponse.cs
IVariantAssignmentResponse.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 // The goal of this class is to just mock out the Microsoft.VariantAssignment close source objects 6 namespace Microsoft.VariantAssignment.Contract 7 { 8 /// <summary> 9 /// Snapshot of variant assignments. 10 /// </summary> 11 public interface IVariantAssignmentResponse : IDisposable 12 { 13 ///// <summary> 14 ///// Gets the serial number of variant assignment configuration snapshot used when assigning variants. 15 ///// </summary> 16 long DataVersion { get; } 17 18 ///// <summary> 19 ///// Get a hash of the response suitable for caching. 20 ///// </summary> 21 // string Thumbprint { get; } 22 23 /// <summary> 24 /// Gets the variants assigned based on request parameters and a variant configuration snapshot. 25 /// </summary> 26 IReadOnlyCollection<IAssignedVariant> AssignedVariants { get; } 27 28 /// <summary> 29 /// Gets feature variables assigned by variants in this response. 30 /// </summary> 31 /// <param name="prefix">(Optional) Filter feature variables where <see cref="IFeatureVariable.KeySegments"/> contains the <paramref name="prefix"/>.</param> 32 /// <returns>Range of matching feature variables.</returns> 33 IReadOnlyList<IFeatureVariable> GetFeatureVariables(IReadOnlyList<string> prefix); 34 35 // this actually part of the interface but gets the job done 36 IReadOnlyList<IFeatureVariable> GetFeatureVariables(); 37 38 // this actually part of the interface but gets the job done 39 string GetAssignmentContext(); 40 41 /// <summary> 42 /// Gets a single feature variable assigned by variants in this response. 43 /// </summary> 44 /// <param name="path">Exact feature variable path.</param> 45 /// <returns>Matching feature variable or null.</returns> 46 IFeatureVariable GetFeatureVariable(IReadOnlyList<string> path); 47 } 48 }