| | 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.Attestation |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Models; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for PolicyOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class PolicyOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Accepts a new policy document and returns a JWT which expresses used in |
| | 26 | | /// preparation to set attestation policy. |
| | 27 | | /// </summary> |
| | 28 | | /// <param name='operations'> |
| | 29 | | /// The operations group for this extension method. |
| | 30 | | /// </param> |
| | 31 | | /// <param name='tenantBaseUrl'> |
| | 32 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 33 | | /// </param> |
| | 34 | | /// <param name='tee'> |
| | 35 | | /// Specifies the trusted execution environment to be used to validate the |
| | 36 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 37 | | /// 'CyResComponent', 'VSMEnclave' |
| | 38 | | /// </param> |
| | 39 | | /// <param name='policyJws'> |
| | 40 | | /// JSON Web Signature (See RFC7515) expressing the new policy |
| | 41 | | /// </param> |
| | 42 | | public static object PrepareToSet(this IPolicyOperations operations, string tenantBaseUrl, string tee, strin |
| | 43 | | { |
| 0 | 44 | | return operations.PrepareToSetAsync(tenantBaseUrl, tee, policyJws).GetAwaiter().GetResult(); |
| | 45 | | } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Accepts a new policy document and returns a JWT which expresses used in |
| | 49 | | /// preparation to set attestation policy. |
| | 50 | | /// </summary> |
| | 51 | | /// <param name='operations'> |
| | 52 | | /// The operations group for this extension method. |
| | 53 | | /// </param> |
| | 54 | | /// <param name='tenantBaseUrl'> |
| | 55 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 56 | | /// </param> |
| | 57 | | /// <param name='tee'> |
| | 58 | | /// Specifies the trusted execution environment to be used to validate the |
| | 59 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 60 | | /// 'CyResComponent', 'VSMEnclave' |
| | 61 | | /// </param> |
| | 62 | | /// <param name='policyJws'> |
| | 63 | | /// JSON Web Signature (See RFC7515) expressing the new policy |
| | 64 | | /// </param> |
| | 65 | | /// <param name='cancellationToken'> |
| | 66 | | /// The cancellation token. |
| | 67 | | /// </param> |
| | 68 | | public static async Task<object> PrepareToSetAsync(this IPolicyOperations operations, string tenantBaseUrl, |
| | 69 | | { |
| 0 | 70 | | using (var _result = await operations.PrepareToSetWithHttpMessagesAsync(tenantBaseUrl, tee, policyJws, n |
| | 71 | | { |
| 0 | 72 | | return _result.Body; |
| | 73 | | } |
| 0 | 74 | | } |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Retrieves the current policy for a given kind of TEE. |
| | 78 | | /// </summary> |
| | 79 | | /// <param name='operations'> |
| | 80 | | /// The operations group for this extension method. |
| | 81 | | /// </param> |
| | 82 | | /// <param name='tenantBaseUrl'> |
| | 83 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 84 | | /// </param> |
| | 85 | | /// <param name='tee'> |
| | 86 | | /// Specifies the trusted execution environment to be used to validate the |
| | 87 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 88 | | /// 'CyResComponent', 'VSMEnclave' |
| | 89 | | /// </param> |
| | 90 | | public static object Get(this IPolicyOperations operations, string tenantBaseUrl, string tee) |
| | 91 | | { |
| 0 | 92 | | return operations.GetAsync(tenantBaseUrl, tee).GetAwaiter().GetResult(); |
| | 93 | | } |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Retrieves the current policy for a given kind of TEE. |
| | 97 | | /// </summary> |
| | 98 | | /// <param name='operations'> |
| | 99 | | /// The operations group for this extension method. |
| | 100 | | /// </param> |
| | 101 | | /// <param name='tenantBaseUrl'> |
| | 102 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 103 | | /// </param> |
| | 104 | | /// <param name='tee'> |
| | 105 | | /// Specifies the trusted execution environment to be used to validate the |
| | 106 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 107 | | /// 'CyResComponent', 'VSMEnclave' |
| | 108 | | /// </param> |
| | 109 | | /// <param name='cancellationToken'> |
| | 110 | | /// The cancellation token. |
| | 111 | | /// </param> |
| | 112 | | public static async Task<object> GetAsync(this IPolicyOperations operations, string tenantBaseUrl, string te |
| | 113 | | { |
| 0 | 114 | | using (var _result = await operations.GetWithHttpMessagesAsync(tenantBaseUrl, tee, null, cancellationTok |
| | 115 | | { |
| 0 | 116 | | return _result.Body; |
| | 117 | | } |
| 0 | 118 | | } |
| | 119 | |
|
| | 120 | | /// <summary> |
| | 121 | | /// Sets the policy for a given kind of TEE. |
| | 122 | | /// </summary> |
| | 123 | | /// <param name='operations'> |
| | 124 | | /// The operations group for this extension method. |
| | 125 | | /// </param> |
| | 126 | | /// <param name='tenantBaseUrl'> |
| | 127 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 128 | | /// </param> |
| | 129 | | /// <param name='tee'> |
| | 130 | | /// Specifies the trusted execution environment to be used to validate the |
| | 131 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 132 | | /// 'CyResComponent', 'VSMEnclave' |
| | 133 | | /// </param> |
| | 134 | | /// <param name='newAttestationPolicy'> |
| | 135 | | /// JWT Expressing the new policy |
| | 136 | | /// </param> |
| | 137 | | public static object Set(this IPolicyOperations operations, string tenantBaseUrl, string tee, string newAtte |
| | 138 | | { |
| 0 | 139 | | return operations.SetAsync(tenantBaseUrl, tee, newAttestationPolicy).GetAwaiter().GetResult(); |
| | 140 | | } |
| | 141 | |
|
| | 142 | | /// <summary> |
| | 143 | | /// Sets the policy for a given kind of TEE. |
| | 144 | | /// </summary> |
| | 145 | | /// <param name='operations'> |
| | 146 | | /// The operations group for this extension method. |
| | 147 | | /// </param> |
| | 148 | | /// <param name='tenantBaseUrl'> |
| | 149 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 150 | | /// </param> |
| | 151 | | /// <param name='tee'> |
| | 152 | | /// Specifies the trusted execution environment to be used to validate the |
| | 153 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 154 | | /// 'CyResComponent', 'VSMEnclave' |
| | 155 | | /// </param> |
| | 156 | | /// <param name='newAttestationPolicy'> |
| | 157 | | /// JWT Expressing the new policy |
| | 158 | | /// </param> |
| | 159 | | /// <param name='cancellationToken'> |
| | 160 | | /// The cancellation token. |
| | 161 | | /// </param> |
| | 162 | | public static async Task<object> SetAsync(this IPolicyOperations operations, string tenantBaseUrl, string te |
| | 163 | | { |
| 0 | 164 | | using (var _result = await operations.SetWithHttpMessagesAsync(tenantBaseUrl, tee, newAttestationPolicy, |
| | 165 | | { |
| 0 | 166 | | return _result.Body; |
| | 167 | | } |
| 0 | 168 | | } |
| | 169 | |
|
| | 170 | | /// <summary> |
| | 171 | | /// Resets the attestation policy for the specified tenant and reverts to the |
| | 172 | | /// default policy. |
| | 173 | | /// </summary> |
| | 174 | | /// <param name='operations'> |
| | 175 | | /// The operations group for this extension method. |
| | 176 | | /// </param> |
| | 177 | | /// <param name='tenantBaseUrl'> |
| | 178 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 179 | | /// </param> |
| | 180 | | /// <param name='tee'> |
| | 181 | | /// Specifies the trusted execution environment to be used to validate the |
| | 182 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 183 | | /// 'CyResComponent', 'VSMEnclave' |
| | 184 | | /// </param> |
| | 185 | | /// <param name='policyJws'> |
| | 186 | | /// JSON Web Signature with an empty policy document |
| | 187 | | /// </param> |
| | 188 | | public static object Reset(this IPolicyOperations operations, string tenantBaseUrl, string tee, string polic |
| | 189 | | { |
| 0 | 190 | | return operations.ResetAsync(tenantBaseUrl, tee, policyJws).GetAwaiter().GetResult(); |
| | 191 | | } |
| | 192 | |
|
| | 193 | | /// <summary> |
| | 194 | | /// Resets the attestation policy for the specified tenant and reverts to the |
| | 195 | | /// default policy. |
| | 196 | | /// </summary> |
| | 197 | | /// <param name='operations'> |
| | 198 | | /// The operations group for this extension method. |
| | 199 | | /// </param> |
| | 200 | | /// <param name='tenantBaseUrl'> |
| | 201 | | /// The tenant name, for example https://mytenant.attest.azure.net. |
| | 202 | | /// </param> |
| | 203 | | /// <param name='tee'> |
| | 204 | | /// Specifies the trusted execution environment to be used to validate the |
| | 205 | | /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', |
| | 206 | | /// 'CyResComponent', 'VSMEnclave' |
| | 207 | | /// </param> |
| | 208 | | /// <param name='policyJws'> |
| | 209 | | /// JSON Web Signature with an empty policy document |
| | 210 | | /// </param> |
| | 211 | | /// <param name='cancellationToken'> |
| | 212 | | /// The cancellation token. |
| | 213 | | /// </param> |
| | 214 | | public static async Task<object> ResetAsync(this IPolicyOperations operations, string tenantBaseUrl, string |
| | 215 | | { |
| 0 | 216 | | using (var _result = await operations.ResetWithHttpMessagesAsync(tenantBaseUrl, tee, policyJws, null, ca |
| | 217 | | { |
| 0 | 218 | | return _result.Body; |
| | 219 | | } |
| 0 | 220 | | } |
| | 221 | |
|
| | 222 | | } |
| | 223 | | } |