Condividi tramite


PolicyParameterMetadata Class

Definition

The definition of a parameter that can be provided to the policy.

public class PolicyParameterMetadata : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.Resources.Policy.Models.PolicyParameterMetadata>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.Resources.Policy.Models.PolicyParameterMetadata>
type PolicyParameterMetadata = class
    interface IJsonModel<PolicyParameterMetadata>
    interface IPersistableModel<PolicyParameterMetadata>
Public Class PolicyParameterMetadata
Implements IJsonModel(Of PolicyParameterMetadata), IPersistableModel(Of PolicyParameterMetadata)
Inheritance
PolicyParameterMetadata
Implements

Constructors

Name Description
PolicyParameterMetadata()

Initializes a new instance of PolicyParameterMetadata.

Properties

Name Description
AllowedValues

The allowed values for the parameter.

To assign an object to the element of this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

DefaultValue

The default value for the parameter if no value is provided.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Metadata

General metadata for the parameter.

Schema

Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Type

The data type of the parameter.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<PolicyParameterMetadata>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<PolicyParameterMetadata>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IPersistableModel<PolicyParameterMetadata>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<PolicyParameterMetadata>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<PolicyParameterMetadata>.Write(ModelReaderWriterOptions)

Applies to