
com.azure.resourcemanager.datafactory.models.CmkIdentityDefinition 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.datafactory.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;
/**
* Managed Identity used for CMK.
*/
@Fluent
public final class CmkIdentityDefinition implements JsonSerializable {
/*
* The resource id of the user assigned identity to authenticate to customer's key vault.
*/
private String userAssignedIdentity;
/**
* Creates an instance of CmkIdentityDefinition class.
*/
public CmkIdentityDefinition() {
}
/**
* Get the userAssignedIdentity property: The resource id of the user assigned identity to authenticate to
* customer's key vault.
*
* @return the userAssignedIdentity value.
*/
public String userAssignedIdentity() {
return this.userAssignedIdentity;
}
/**
* Set the userAssignedIdentity property: The resource id of the user assigned identity to authenticate to
* customer's key vault.
*
* @param userAssignedIdentity the userAssignedIdentity value to set.
* @return the CmkIdentityDefinition object itself.
*/
public CmkIdentityDefinition withUserAssignedIdentity(String userAssignedIdentity) {
this.userAssignedIdentity = userAssignedIdentity;
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("userAssignedIdentity", this.userAssignedIdentity);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CmkIdentityDefinition from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CmkIdentityDefinition 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 CmkIdentityDefinition.
*/
public static CmkIdentityDefinition fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CmkIdentityDefinition deserializedCmkIdentityDefinition = new CmkIdentityDefinition();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("userAssignedIdentity".equals(fieldName)) {
deserializedCmkIdentityDefinition.userAssignedIdentity = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedCmkIdentityDefinition;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy