com.azure.security.keyvault.certificates.implementation.models.CertificateMergeParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-security-keyvault-certificates Show documentation
Show all versions of azure-security-keyvault-certificates Show documentation
This module contains client library for Microsoft Azure KeyVault Certificates.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.security.keyvault.certificates.implementation.models;
import com.azure.core.annotation.Fluent;
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.util.List;
import java.util.Map;
/** The certificate merge parameters. */
@Fluent
public final class CertificateMergeParameters implements JsonSerializable {
/*
* The certificate or the certificate chain to merge.
*/
private List x509Certificates;
/*
* The attributes of the certificate (optional).
*/
private CertificateAttributes certificateAttributes;
/*
* Application specific metadata in the form of key-value pairs.
*/
private Map tags;
/** Creates an instance of CertificateMergeParameters class. */
public CertificateMergeParameters() {}
/**
* Get the x509Certificates property: The certificate or the certificate chain to merge.
*
* @return the x509Certificates value.
*/
public List getX509Certificates() {
return this.x509Certificates;
}
/**
* Set the x509Certificates property: The certificate or the certificate chain to merge.
*
* @param x509Certificates the x509Certificates value to set.
* @return the CertificateMergeParameters object itself.
*/
public CertificateMergeParameters setX509Certificates(List x509Certificates) {
this.x509Certificates = x509Certificates;
return this;
}
/**
* Get the certificateAttributes property: The attributes of the certificate (optional).
*
* @return the certificateAttributes value.
*/
public CertificateAttributes getCertificateAttributes() {
return this.certificateAttributes;
}
/**
* Set the certificateAttributes property: The attributes of the certificate (optional).
*
* @param certificateAttributes the certificateAttributes value to set.
* @return the CertificateMergeParameters object itself.
*/
public CertificateMergeParameters setCertificateAttributes(CertificateAttributes certificateAttributes) {
this.certificateAttributes = certificateAttributes;
return this;
}
/**
* Get the tags property: Application specific metadata in the form of key-value pairs.
*
* @return the tags value.
*/
public Map getTags() {
return this.tags;
}
/**
* Set the tags property: Application specific metadata in the form of key-value pairs.
*
* @param tags the tags value to set.
* @return the CertificateMergeParameters object itself.
*/
public CertificateMergeParameters setTags(Map tags) {
this.tags = tags;
return this;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("x5c", this.x509Certificates, (writer, element) -> writer.writeBinary(element));
jsonWriter.writeJsonField("attributes", this.certificateAttributes);
jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CertificateMergeParameters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CertificateMergeParameters 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 CertificateMergeParameters.
*/
public static CertificateMergeParameters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(
reader -> {
CertificateMergeParameters deserializedCertificateMergeParameters =
new CertificateMergeParameters();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("x5c".equals(fieldName)) {
List x509Certificates = reader.readArray(reader1 -> reader1.getBinary());
deserializedCertificateMergeParameters.x509Certificates = x509Certificates;
} else if ("attributes".equals(fieldName)) {
deserializedCertificateMergeParameters.certificateAttributes =
CertificateAttributes.fromJson(reader);
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedCertificateMergeParameters.tags = tags;
} else {
reader.skipChildren();
}
}
return deserializedCertificateMergeParameters;
});
}
}