com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData 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.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Describes the partner that created the assessment.
*/
@Fluent
public final class SecurityAssessmentMetadataPartnerData
implements JsonSerializable {
/*
* Name of the company of the partner
*/
private String partnerName;
/*
* Name of the product of the partner that created the assessment
*/
private String productName;
/*
* Secret to authenticate the partner and verify it created the assessment - write only
*/
private String secret;
/**
* Creates an instance of SecurityAssessmentMetadataPartnerData class.
*/
public SecurityAssessmentMetadataPartnerData() {
}
/**
* Get the partnerName property: Name of the company of the partner.
*
* @return the partnerName value.
*/
public String partnerName() {
return this.partnerName;
}
/**
* Set the partnerName property: Name of the company of the partner.
*
* @param partnerName the partnerName value to set.
* @return the SecurityAssessmentMetadataPartnerData object itself.
*/
public SecurityAssessmentMetadataPartnerData withPartnerName(String partnerName) {
this.partnerName = partnerName;
return this;
}
/**
* Get the productName property: Name of the product of the partner that created the assessment.
*
* @return the productName value.
*/
public String productName() {
return this.productName;
}
/**
* Set the productName property: Name of the product of the partner that created the assessment.
*
* @param productName the productName value to set.
* @return the SecurityAssessmentMetadataPartnerData object itself.
*/
public SecurityAssessmentMetadataPartnerData withProductName(String productName) {
this.productName = productName;
return this;
}
/**
* Get the secret property: Secret to authenticate the partner and verify it created the assessment - write only.
*
* @return the secret value.
*/
public String secret() {
return this.secret;
}
/**
* Set the secret property: Secret to authenticate the partner and verify it created the assessment - write only.
*
* @param secret the secret value to set.
* @return the SecurityAssessmentMetadataPartnerData object itself.
*/
public SecurityAssessmentMetadataPartnerData withSecret(String secret) {
this.secret = secret;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (partnerName() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property partnerName in model SecurityAssessmentMetadataPartnerData"));
}
if (secret() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property secret in model SecurityAssessmentMetadataPartnerData"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentMetadataPartnerData.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("partnerName", this.partnerName);
jsonWriter.writeStringField("secret", this.secret);
jsonWriter.writeStringField("productName", this.productName);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SecurityAssessmentMetadataPartnerData from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SecurityAssessmentMetadataPartnerData if the JsonReader was pointing to an instance of it,
* or null if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the SecurityAssessmentMetadataPartnerData.
*/
public static SecurityAssessmentMetadataPartnerData fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SecurityAssessmentMetadataPartnerData deserializedSecurityAssessmentMetadataPartnerData
= new SecurityAssessmentMetadataPartnerData();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("partnerName".equals(fieldName)) {
deserializedSecurityAssessmentMetadataPartnerData.partnerName = reader.getString();
} else if ("secret".equals(fieldName)) {
deserializedSecurityAssessmentMetadataPartnerData.secret = reader.getString();
} else if ("productName".equals(fieldName)) {
deserializedSecurityAssessmentMetadataPartnerData.productName = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedSecurityAssessmentMetadataPartnerData;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy