BillingTrustRuleCollection.GetIfExistsAsync(String, CancellationToken) Method

Definition

Tries to get details for this resource from the service.

  • Request Path. : /{resourceUri}/providers/Microsoft.BillingTrust/assessments/default/rules/{ruleName}.
  • Operation Id. : Rules_Get.
  • Default Api Version. : 2026-03-17-preview.
public virtual System.Threading.Tasks.Task<Azure.NullableResponse<Azure.ResourceManager.Billing.Trust.BillingTrustRuleResource>> GetIfExistsAsync(string ruleName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetIfExistsAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.NullableResponse<Azure.ResourceManager.Billing.Trust.BillingTrustRuleResource>>
override this.GetIfExistsAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.NullableResponse<Azure.ResourceManager.Billing.Trust.BillingTrustRuleResource>>
Public Overridable Function GetIfExistsAsync (ruleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of NullableResponse(Of BillingTrustRuleResource))

Parameters

ruleName
String

The name of the rule. Rules are created by the service when the parent assessment is created — the available rule names are determined by the assessment template. Names start with an alphanumeric character and may contain letters, digits, underscores, and hyphens.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

ruleName is null.

ruleName is an empty string, and was expected to be non-empty.

Applies to