com.azure.resourcemanager.mediaservices.models.ResourceIdentity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-mediaservices Show documentation
Show all versions of azure-resourcemanager-mediaservices Show documentation
This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-account-2023-01.
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.resourcemanager.mediaservices.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;
/**
* The ResourceIdentity model.
*/
@Fluent
public final class ResourceIdentity implements JsonSerializable {
/*
* The user assigned managed identity's ARM ID to use when accessing a resource.
*/
private String userAssignedIdentity;
/*
* Indicates whether to use System Assigned Managed Identity. Mutual exclusive with User Assigned Managed Identity.
*/
private boolean useSystemAssignedIdentity;
/**
* Creates an instance of ResourceIdentity class.
*/
public ResourceIdentity() {
}
/**
* Get the userAssignedIdentity property: The user assigned managed identity's ARM ID to use when accessing a
* resource.
*
* @return the userAssignedIdentity value.
*/
public String userAssignedIdentity() {
return this.userAssignedIdentity;
}
/**
* Set the userAssignedIdentity property: The user assigned managed identity's ARM ID to use when accessing a
* resource.
*
* @param userAssignedIdentity the userAssignedIdentity value to set.
* @return the ResourceIdentity object itself.
*/
public ResourceIdentity withUserAssignedIdentity(String userAssignedIdentity) {
this.userAssignedIdentity = userAssignedIdentity;
return this;
}
/**
* Get the useSystemAssignedIdentity property: Indicates whether to use System Assigned Managed Identity. Mutual
* exclusive with User Assigned Managed Identity.
*
* @return the useSystemAssignedIdentity value.
*/
public boolean useSystemAssignedIdentity() {
return this.useSystemAssignedIdentity;
}
/**
* Set the useSystemAssignedIdentity property: Indicates whether to use System Assigned Managed Identity. Mutual
* exclusive with User Assigned Managed Identity.
*
* @param useSystemAssignedIdentity the useSystemAssignedIdentity value to set.
* @return the ResourceIdentity object itself.
*/
public ResourceIdentity withUseSystemAssignedIdentity(boolean useSystemAssignedIdentity) {
this.useSystemAssignedIdentity = useSystemAssignedIdentity;
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.writeBooleanField("useSystemAssignedIdentity", this.useSystemAssignedIdentity);
jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ResourceIdentity from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ResourceIdentity 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 ResourceIdentity.
*/
public static ResourceIdentity fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ResourceIdentity deserializedResourceIdentity = new ResourceIdentity();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("useSystemAssignedIdentity".equals(fieldName)) {
deserializedResourceIdentity.useSystemAssignedIdentity = reader.getBoolean();
} else if ("userAssignedIdentity".equals(fieldName)) {
deserializedResourceIdentity.userAssignedIdentity = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedResourceIdentity;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy