com.azure.resourcemanager.security.models.DevOpsPolicyProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-security Show documentation
Show all versions of azure-resourcemanager-security Show documentation
This package contains Microsoft Azure SDK for Security Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.security.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.UUID;
/**
* Policy DevOps Resource properties that contain the full definition of a DevOps policy resource.
*/
@Fluent
public final class DevOpsPolicyProperties implements JsonSerializable {
/*
* Gets the resource status message.
*/
private String provisioningStatusMessage;
/*
* Gets the time when resource was last checked.
*/
private OffsetDateTime provisioningStatusUpdateTimeUtc;
/*
* The provisioning state of the resource.
*
* Pending - Provisioning pending.
* Failed - Provisioning failed.
* Succeeded - Successful provisioning.
* Canceled - Provisioning canceled.
* PendingDeletion - Deletion pending.
* DeletionSuccess - Deletion successful.
* DeletionFailure - Deletion failure.
*/
private DevOpsProvisioningState provisioningState;
/*
* DevOps Policy creation sources.
*/
private DevOpsPolicySource source;
/*
* Gets the policy resource GUID.
*/
private UUID policyId;
/*
* Gets the web URL.
*/
private String webUrl;
/*
* Gets or sets the semantic version.
*/
private String version;
/*
* DevOps Policy resource types.
*/
private DevOpsPolicyType type;
/*
* Gets or sets the policy definition content JSON string.
*/
private String content;
/**
* Creates an instance of DevOpsPolicyProperties class.
*/
public DevOpsPolicyProperties() {
}
/**
* Get the provisioningStatusMessage property: Gets the resource status message.
*
* @return the provisioningStatusMessage value.
*/
public String provisioningStatusMessage() {
return this.provisioningStatusMessage;
}
/**
* Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked.
*
* @return the provisioningStatusUpdateTimeUtc value.
*/
public OffsetDateTime provisioningStatusUpdateTimeUtc() {
return this.provisioningStatusUpdateTimeUtc;
}
/**
* Get the provisioningState property: The provisioning state of the resource.
*
* Pending - Provisioning pending.
* Failed - Provisioning failed.
* Succeeded - Successful provisioning.
* Canceled - Provisioning canceled.
* PendingDeletion - Deletion pending.
* DeletionSuccess - Deletion successful.
* DeletionFailure - Deletion failure.
*
* @return the provisioningState value.
*/
public DevOpsProvisioningState provisioningState() {
return this.provisioningState;
}
/**
* Get the source property: DevOps Policy creation sources.
*
* @return the source value.
*/
public DevOpsPolicySource source() {
return this.source;
}
/**
* Set the source property: DevOps Policy creation sources.
*
* @param source the source value to set.
* @return the DevOpsPolicyProperties object itself.
*/
public DevOpsPolicyProperties withSource(DevOpsPolicySource source) {
this.source = source;
return this;
}
/**
* Get the policyId property: Gets the policy resource GUID.
*
* @return the policyId value.
*/
public UUID policyId() {
return this.policyId;
}
/**
* Get the webUrl property: Gets the web URL.
*
* @return the webUrl value.
*/
public String webUrl() {
return this.webUrl;
}
/**
* Get the version property: Gets or sets the semantic version.
*
* @return the version value.
*/
public String version() {
return this.version;
}
/**
* Set the version property: Gets or sets the semantic version.
*
* @param version the version value to set.
* @return the DevOpsPolicyProperties object itself.
*/
public DevOpsPolicyProperties withVersion(String version) {
this.version = version;
return this;
}
/**
* Get the type property: DevOps Policy resource types.
*
* @return the type value.
*/
public DevOpsPolicyType type() {
return this.type;
}
/**
* Set the type property: DevOps Policy resource types.
*
* @param type the type value to set.
* @return the DevOpsPolicyProperties object itself.
*/
public DevOpsPolicyProperties withType(DevOpsPolicyType type) {
this.type = type;
return this;
}
/**
* Get the content property: Gets or sets the policy definition content JSON string.
*
* @return the content value.
*/
public String content() {
return this.content;
}
/**
* Set the content property: Gets or sets the policy definition content JSON string.
*
* @param content the content value to set.
* @return the DevOpsPolicyProperties object itself.
*/
public DevOpsPolicyProperties withContent(String content) {
this.content = content;
return this;
}
/**
* 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();
jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString());
jsonWriter.writeStringField("version", this.version);
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeStringField("content", this.content);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DevOpsPolicyProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DevOpsPolicyProperties 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 DevOpsPolicyProperties.
*/
public static DevOpsPolicyProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DevOpsPolicyProperties deserializedDevOpsPolicyProperties = new DevOpsPolicyProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("provisioningStatusMessage".equals(fieldName)) {
deserializedDevOpsPolicyProperties.provisioningStatusMessage = reader.getString();
} else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) {
deserializedDevOpsPolicyProperties.provisioningStatusUpdateTimeUtc = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("provisioningState".equals(fieldName)) {
deserializedDevOpsPolicyProperties.provisioningState
= DevOpsProvisioningState.fromString(reader.getString());
} else if ("source".equals(fieldName)) {
deserializedDevOpsPolicyProperties.source = DevOpsPolicySource.fromString(reader.getString());
} else if ("policyId".equals(fieldName)) {
deserializedDevOpsPolicyProperties.policyId
= reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
} else if ("webUrl".equals(fieldName)) {
deserializedDevOpsPolicyProperties.webUrl = reader.getString();
} else if ("version".equals(fieldName)) {
deserializedDevOpsPolicyProperties.version = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedDevOpsPolicyProperties.type = DevOpsPolicyType.fromString(reader.getString());
} else if ("content".equals(fieldName)) {
deserializedDevOpsPolicyProperties.content = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedDevOpsPolicyProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy