-
Notifications
You must be signed in to change notification settings - Fork 256
/
CosmosPermission.xml
183 lines (183 loc) · 16.4 KB
/
CosmosPermission.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<Type Name="CosmosPermission" FullName="Azure.Cosmos.CosmosPermission">
<TypeSignature Language="C#" Value="public abstract class CosmosPermission" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit CosmosPermission extends System.Object" />
<TypeSignature Language="DocId" Value="T:Azure.Cosmos.CosmosPermission" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class CosmosPermission" />
<TypeSignature Language="F#" Value="type CosmosPermission = class" />
<AssemblyInfo>
<AssemblyName>Azure.Cosmos</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>
Operations for reading, replacing, or deleting a specific permission by id. Permissions are used to create ResourceTokens. Resource tokens provide access to the application resources within a database. Resource tokens:
<list type="bullet"><item><description>Provide access to specific containers, partition keys, documents, attachments, stored procedures, triggers, and UDFs.</description></item><item><description>Are created when a user is granted permissions to a specific resource.</description></item><item><description>Are recreated when a permission resource is acted upon on by POST, GET, or PUT call.</description></item><item><description>Use a hash resource token specifically constructed for the user, resource, and permission.</description></item><item><description>Are time bound with a customizable validity period. The default valid timespan is one hour. Token lifetime, however, may be explicitly specified, up to a maximum of 24 hours.</description></item><item><description>Provide a safe alternative to giving out the master key.</description></item><item><description>Enable clients to read, write, and delete resources in the Cosmos DB account according to the permissions they've been granted.</description></item></list></summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected CosmosPermission ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.Cosmos.CosmosPermission.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.Cosmos</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DeleteAsync">
<MemberSignature Language="C#" Value="public abstract System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse> DeleteAsync (Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Cosmos.PermissionResponse> DeleteAsync(class Azure.Cosmos.RequestOptions requestOptions, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.Cosmos.CosmosPermission.DeleteAsync(Azure.Cosmos.RequestOptions,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Function DeleteAsync (Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PermissionResponse)" />
<MemberSignature Language="F#" Value="abstract member DeleteAsync : Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse>" Usage="cosmosPermission.DeleteAsync (requestOptions, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.Cosmos</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="requestOptions" Type="Azure.Cosmos.RequestOptions" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="requestOptions">(Optional) The options for the user request <see cref="T:Azure.Cosmos.RequestOptions" /></param>
<param name="cancellationToken">(Optional) <see cref="T:System.Threading.CancellationToken" /> representing request cancellation.</param>
<summary>
Delete a <see cref="T:Azure.Cosmos.PermissionProperties" /> from the Azure Cosmos DB service as an asynchronous operation. This will not revoke existing ResourceTokens.
</summary>
<returns>A <see cref="T:System.Threading.Tasks.Task" /> containing a <see cref="T:Azure.Cosmos.PermissionResponse" /> which will contain information about the request issued.</returns>
<remarks>To be added.</remarks>
<exception cref="T:Azure.Cosmos.CosmosException">This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a permission are:
<list type="table"><listheader><term>StatusCode</term><description>Reason for exception</description></listheader><item><term>404</term><description>NotFound - This means the resource or parent resource you tried to delete did not exist.</description></item></list></exception>
<example>
<code language="c#"><![CDATA[
CosmosUser user = this.database.GetUser("userId");
CosmosPermission permission = user.GetPermission("permissionId");
PermissionResponse response = await permission.DeleteAsync();
]]></code>
</example>
</Docs>
</Member>
<Member MemberName="Id">
<MemberSignature Language="C#" Value="public abstract string Id { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Id" />
<MemberSignature Language="DocId" Value="P:Azure.Cosmos.CosmosPermission.Id" />
<MemberSignature Language="VB.NET" Value="Public MustOverride ReadOnly Property Id As String" />
<MemberSignature Language="F#" Value="member this.Id : string" Usage="Azure.Cosmos.CosmosPermission.Id" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.Cosmos</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
The Id of the Cosmos Permission
</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ReadAsync">
<MemberSignature Language="C#" Value="public abstract System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse> ReadAsync (int? tokenExpiryInSeconds = default, Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Cosmos.PermissionResponse> ReadAsync(valuetype System.Nullable`1<int32> tokenExpiryInSeconds, class Azure.Cosmos.RequestOptions requestOptions, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.Cosmos.CosmosPermission.ReadAsync(System.Nullable{System.Int32},Azure.Cosmos.RequestOptions,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Function ReadAsync (Optional tokenExpiryInSeconds As Nullable(Of Integer) = Nothing, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PermissionResponse)" />
<MemberSignature Language="F#" Value="abstract member ReadAsync : Nullable<int> * Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse>" Usage="cosmosPermission.ReadAsync (tokenExpiryInSeconds, requestOptions, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.Cosmos</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="tokenExpiryInSeconds" Type="System.Nullable<System.Int32>" />
<Parameter Name="requestOptions" Type="Azure.Cosmos.RequestOptions" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="tokenExpiryInSeconds">(Optional) The expiry time for resource token in seconds. This value can range from 10 seconds, to 24 hours (or 86,400 seconds). The default value for this is 1 hour (or 3,600 seconds). This does not change the default value for future tokens.</param>
<param name="requestOptions">(Optional) The options for the permission request <see cref="T:Azure.Cosmos.RequestOptions" /></param>
<param name="cancellationToken">(Optional) <see cref="T:System.Threading.CancellationToken" /> representing request cancellation.</param>
<summary>
Reads a <see cref="T:Azure.Cosmos.PermissionProperties" /> from the Azure Cosmos service as an asynchronous operation. Each read will return a new ResourceToken with its respective expiration.
</summary>
<returns>
A <see cref="T:System.Threading.Tasks.Task" /> containing a <see cref="T:Azure.Cosmos.PermissionResponse" /> which wraps a <see cref="T:Azure.Cosmos.PermissionProperties" /> containing the read resource record.
</returns>
<remarks>To be added.</remarks>
<exception cref="T:Azure.Cosmos.CosmosException">This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a permission are:
<list type="table"><listheader><term>StatusCode</term><description>Reason for exception</description></listheader><item><term>404</term><description>NotFound - This means the resource or parent resource you tried to read did not exist.</description></item><item><term>429</term><description>TooManyRequests - This means you have exceeded the number of request units per second. Consult the DocumentClientException.RetryAfter value to see how long you should wait before retrying this operation.</description></item></list></exception>
<example>
<code language="c#"><![CDATA[
CosmosUser user = this.database.GetUser("userId");
CosmosPermission permission= user.GetPermission("permissionId");
PermissionProperties permissionProperties = await permission.ReadAsync(tokenExpiryInSeconds: 9000);
]]></code>
</example>
</Docs>
</Member>
<Member MemberName="ReplaceAsync">
<MemberSignature Language="C#" Value="public abstract System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse> ReplaceAsync (Azure.Cosmos.PermissionProperties permissionProperties, int? tokenExpiryInSeconds = default, Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Cosmos.PermissionResponse> ReplaceAsync(class Azure.Cosmos.PermissionProperties permissionProperties, valuetype System.Nullable`1<int32> tokenExpiryInSeconds, class Azure.Cosmos.RequestOptions requestOptions, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.Cosmos.CosmosPermission.ReplaceAsync(Azure.Cosmos.PermissionProperties,System.Nullable{System.Int32},Azure.Cosmos.RequestOptions,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="Public MustOverride Function ReplaceAsync (permissionProperties As PermissionProperties, Optional tokenExpiryInSeconds As Nullable(Of Integer) = Nothing, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PermissionResponse)" />
<MemberSignature Language="F#" Value="abstract member ReplaceAsync : Azure.Cosmos.PermissionProperties * Nullable<int> * Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse>" Usage="cosmosPermission.ReplaceAsync (permissionProperties, tokenExpiryInSeconds, requestOptions, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.Cosmos</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Cosmos.PermissionResponse></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="permissionProperties" Type="Azure.Cosmos.PermissionProperties" />
<Parameter Name="tokenExpiryInSeconds" Type="System.Nullable<System.Int32>" />
<Parameter Name="requestOptions" Type="Azure.Cosmos.RequestOptions" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<param name="permissionProperties">The <see cref="T:Azure.Cosmos.PermissionProperties" /> object.</param>
<param name="tokenExpiryInSeconds">(Optional) The expiry time for resource token in seconds. This value can range from 10 seconds, to 24 hours (or 86,400 seconds). The default value for this is 1 hour (or 3,600 seconds). This does not change the default value for future tokens.</param>
<param name="requestOptions">(Optional) The options for the user request <see cref="T:Azure.Cosmos.RequestOptions" /></param>
<param name="cancellationToken">(Optional) <see cref="T:System.Threading.CancellationToken" /> representing request cancellation.</param>
<summary>
Replace a <see cref="T:Azure.Cosmos.PermissionProperties" /> from the Azure Cosmos service as an asynchronous operation. This will not revoke existing ResourceTokens.
</summary>
<returns>
A <see cref="T:System.Threading.Tasks.Task" /> containing a <see cref="T:Azure.Cosmos.PermissionResponse" /> which wraps a <see cref="T:Azure.Cosmos.PermissionProperties" /> containing the replace resource record.
</returns>
<remarks>To be added.</remarks>
<exception cref="T:Azure.Cosmos.CosmosException">This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a permission are:
<list type="table"><listheader><term>StatusCode</term><description>Reason for exception</description></listheader><item><term>404</term><description>NotFound - This means the resource or parent resource you tried to read did not exist.</description></item><item><term>429</term><description>TooManyRequests - This means you have exceeded the number of request units per second. Consult the DocumentClientException.RetryAfter value to see how long you should wait before retrying this operation.</description></item></list></exception>
<example>
<code language="c#"><![CDATA[
PermissionProperties permissionProperties = permissionReadResponse;
permissionProperties.Id = "newuser";
PermissionResponse response = await permission.ReplaceAsync(permissionProperties, tokenExpiryInSeconds: 9000);
PermissionProperties replacedProperties = response;
]]></code>
</example>
</Docs>
</Member>
</Members>
</Type>