
com.azure.resourcemanager.policyinsights.models.PolicyDetails Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.policyinsights.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* The policy details.
*/
@Immutable
public final class PolicyDetails implements JsonSerializable {
/*
* The ID of the policy definition.
*/
private String policyDefinitionId;
/*
* The ID of the policy assignment.
*/
private String policyAssignmentId;
/*
* The display name of the policy assignment.
*/
private String policyAssignmentDisplayName;
/*
* The scope of the policy assignment.
*/
private String policyAssignmentScope;
/*
* The ID of the policy set definition.
*/
private String policySetDefinitionId;
/*
* The policy definition reference ID within the policy set definition.
*/
private String policyDefinitionReferenceId;
/**
* Creates an instance of PolicyDetails class.
*/
public PolicyDetails() {
}
/**
* Get the policyDefinitionId property: The ID of the policy definition.
*
* @return the policyDefinitionId value.
*/
public String policyDefinitionId() {
return this.policyDefinitionId;
}
/**
* Get the policyAssignmentId property: The ID of the policy assignment.
*
* @return the policyAssignmentId value.
*/
public String policyAssignmentId() {
return this.policyAssignmentId;
}
/**
* Get the policyAssignmentDisplayName property: The display name of the policy assignment.
*
* @return the policyAssignmentDisplayName value.
*/
public String policyAssignmentDisplayName() {
return this.policyAssignmentDisplayName;
}
/**
* Get the policyAssignmentScope property: The scope of the policy assignment.
*
* @return the policyAssignmentScope value.
*/
public String policyAssignmentScope() {
return this.policyAssignmentScope;
}
/**
* Get the policySetDefinitionId property: The ID of the policy set definition.
*
* @return the policySetDefinitionId value.
*/
public String policySetDefinitionId() {
return this.policySetDefinitionId;
}
/**
* Get the policyDefinitionReferenceId property: The policy definition reference ID within the policy set
* definition.
*
* @return the policyDefinitionReferenceId value.
*/
public String policyDefinitionReferenceId() {
return this.policyDefinitionReferenceId;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of PolicyDetails from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of PolicyDetails if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the PolicyDetails.
*/
public static PolicyDetails fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
PolicyDetails deserializedPolicyDetails = new PolicyDetails();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("policyDefinitionId".equals(fieldName)) {
deserializedPolicyDetails.policyDefinitionId = reader.getString();
} else if ("policyAssignmentId".equals(fieldName)) {
deserializedPolicyDetails.policyAssignmentId = reader.getString();
} else if ("policyAssignmentDisplayName".equals(fieldName)) {
deserializedPolicyDetails.policyAssignmentDisplayName = reader.getString();
} else if ("policyAssignmentScope".equals(fieldName)) {
deserializedPolicyDetails.policyAssignmentScope = reader.getString();
} else if ("policySetDefinitionId".equals(fieldName)) {
deserializedPolicyDetails.policySetDefinitionId = reader.getString();
} else if ("policyDefinitionReferenceId".equals(fieldName)) {
deserializedPolicyDetails.policyDefinitionReferenceId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedPolicyDetails;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy