EasmClient.GetSavedFilter Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetSavedFilter(String, RequestContext) |
[Protocol Method] Retrieve a saved filter by filterName.
|
GetSavedFilter(String, CancellationToken) |
Retrieve a saved filter by filterName. |
GetSavedFilter(String, RequestContext)
- Source:
- EasmClient.cs
[Protocol Method] Retrieve a saved filter by filterName.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetSavedFilter(String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetSavedFilter (string filterName, Azure.RequestContext context);
abstract member GetSavedFilter : string * Azure.RequestContext -> Azure.Response
override this.GetSavedFilter : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetSavedFilter (filterName As String, context As RequestContext) As Response
Parameters
- filterName
- String
The caller provided unique name for the resource.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
filterName
is null.
filterName
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call GetSavedFilter and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response response = client.GetSavedFilter("<filterName>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
This sample shows how to call GetSavedFilter with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response response = client.GetSavedFilter("<filterName>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("filter").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Applies to
GetSavedFilter(String, CancellationToken)
- Source:
- EasmClient.cs
Retrieve a saved filter by filterName.
public virtual Azure.Response<Azure.Analytics.Defender.Easm.SavedFilter> GetSavedFilter (string filterName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSavedFilter : string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Defender.Easm.SavedFilter>
override this.GetSavedFilter : string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Defender.Easm.SavedFilter>
Public Overridable Function GetSavedFilter (filterName As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of SavedFilter)
Parameters
- filterName
- String
The caller provided unique name for the resource.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
filterName
is null.
filterName
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetSavedFilter.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response<SavedFilter> response = client.GetSavedFilter("<filterName>");
This sample shows how to call GetSavedFilter with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
Response<SavedFilter> response = client.GetSavedFilter("<filterName>");