![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleProperties 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.authorization.fluent.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 com.azure.resourcemanager.authorization.models.AssignmentType;
import com.azure.resourcemanager.authorization.models.ExpandedProperties;
import com.azure.resourcemanager.authorization.models.MemberType;
import com.azure.resourcemanager.authorization.models.PrincipalType;
import com.azure.resourcemanager.authorization.models.Status;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
/**
* Role assignment schedule properties with scope.
*/
@Fluent
public final class RoleAssignmentScheduleProperties implements JsonSerializable {
/*
* The role assignment schedule scope.
*/
private String scope;
/*
* The role definition ID.
*/
private String roleDefinitionId;
/*
* The principal ID.
*/
private String principalId;
/*
* The principal type of the assigned principal ID.
*/
private PrincipalType principalType;
/*
* The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule
*/
private String roleAssignmentScheduleRequestId;
/*
* The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule
*/
private String linkedRoleEligibilityScheduleId;
/*
* Assignment type of the role assignment schedule
*/
private AssignmentType assignmentType;
/*
* Membership type of the role assignment schedule
*/
private MemberType memberType;
/*
* The status of the role assignment schedule.
*/
private Status status;
/*
* Start DateTime when role assignment schedule
*/
private OffsetDateTime startDateTime;
/*
* End DateTime when role assignment schedule
*/
private OffsetDateTime endDateTime;
/*
* The conditions on the role assignment. This limits the resources it can be assigned to.
* e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase
* 'foo_storage_container'
*/
private String condition;
/*
* Version of the condition. Currently accepted value is '2.0'
*/
private String conditionVersion;
/*
* DateTime when role assignment schedule was created
*/
private OffsetDateTime createdOn;
/*
* DateTime when role assignment schedule was modified
*/
private OffsetDateTime updatedOn;
/*
* Additional properties of principal, scope and role definition
*/
private ExpandedProperties expandedProperties;
/**
* Creates an instance of RoleAssignmentScheduleProperties class.
*/
public RoleAssignmentScheduleProperties() {
}
/**
* Get the scope property: The role assignment schedule scope.
*
* @return the scope value.
*/
public String scope() {
return this.scope;
}
/**
* Set the scope property: The role assignment schedule scope.
*
* @param scope the scope value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withScope(String scope) {
this.scope = scope;
return this;
}
/**
* Get the roleDefinitionId property: The role definition ID.
*
* @return the roleDefinitionId value.
*/
public String roleDefinitionId() {
return this.roleDefinitionId;
}
/**
* Set the roleDefinitionId property: The role definition ID.
*
* @param roleDefinitionId the roleDefinitionId value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withRoleDefinitionId(String roleDefinitionId) {
this.roleDefinitionId = roleDefinitionId;
return this;
}
/**
* Get the principalId property: The principal ID.
*
* @return the principalId value.
*/
public String principalId() {
return this.principalId;
}
/**
* Set the principalId property: The principal ID.
*
* @param principalId the principalId value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withPrincipalId(String principalId) {
this.principalId = principalId;
return this;
}
/**
* Get the principalType property: The principal type of the assigned principal ID.
*
* @return the principalType value.
*/
public PrincipalType principalType() {
return this.principalType;
}
/**
* Set the principalType property: The principal type of the assigned principal ID.
*
* @param principalType the principalType value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withPrincipalType(PrincipalType principalType) {
this.principalType = principalType;
return this;
}
/**
* Get the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this
* roleAssignmentSchedule.
*
* @return the roleAssignmentScheduleRequestId value.
*/
public String roleAssignmentScheduleRequestId() {
return this.roleAssignmentScheduleRequestId;
}
/**
* Set the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this
* roleAssignmentSchedule.
*
* @param roleAssignmentScheduleRequestId the roleAssignmentScheduleRequestId value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties
withRoleAssignmentScheduleRequestId(String roleAssignmentScheduleRequestId) {
this.roleAssignmentScheduleRequestId = roleAssignmentScheduleRequestId;
return this;
}
/**
* Get the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this
* roleAssignmentSchedule.
*
* @return the linkedRoleEligibilityScheduleId value.
*/
public String linkedRoleEligibilityScheduleId() {
return this.linkedRoleEligibilityScheduleId;
}
/**
* Set the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this
* roleAssignmentSchedule.
*
* @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties
withLinkedRoleEligibilityScheduleId(String linkedRoleEligibilityScheduleId) {
this.linkedRoleEligibilityScheduleId = linkedRoleEligibilityScheduleId;
return this;
}
/**
* Get the assignmentType property: Assignment type of the role assignment schedule.
*
* @return the assignmentType value.
*/
public AssignmentType assignmentType() {
return this.assignmentType;
}
/**
* Set the assignmentType property: Assignment type of the role assignment schedule.
*
* @param assignmentType the assignmentType value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withAssignmentType(AssignmentType assignmentType) {
this.assignmentType = assignmentType;
return this;
}
/**
* Get the memberType property: Membership type of the role assignment schedule.
*
* @return the memberType value.
*/
public MemberType memberType() {
return this.memberType;
}
/**
* Set the memberType property: Membership type of the role assignment schedule.
*
* @param memberType the memberType value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withMemberType(MemberType memberType) {
this.memberType = memberType;
return this;
}
/**
* Get the status property: The status of the role assignment schedule.
*
* @return the status value.
*/
public Status status() {
return this.status;
}
/**
* Set the status property: The status of the role assignment schedule.
*
* @param status the status value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withStatus(Status status) {
this.status = status;
return this;
}
/**
* Get the startDateTime property: Start DateTime when role assignment schedule.
*
* @return the startDateTime value.
*/
public OffsetDateTime startDateTime() {
return this.startDateTime;
}
/**
* Set the startDateTime property: Start DateTime when role assignment schedule.
*
* @param startDateTime the startDateTime value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withStartDateTime(OffsetDateTime startDateTime) {
this.startDateTime = startDateTime;
return this;
}
/**
* Get the endDateTime property: End DateTime when role assignment schedule.
*
* @return the endDateTime value.
*/
public OffsetDateTime endDateTime() {
return this.endDateTime;
}
/**
* Set the endDateTime property: End DateTime when role assignment schedule.
*
* @param endDateTime the endDateTime value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withEndDateTime(OffsetDateTime endDateTime) {
this.endDateTime = endDateTime;
return this;
}
/**
* Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned
* to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]
* StringEqualsIgnoreCase 'foo_storage_container'.
*
* @return the condition value.
*/
public String condition() {
return this.condition;
}
/**
* Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned
* to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]
* StringEqualsIgnoreCase 'foo_storage_container'.
*
* @param condition the condition value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withCondition(String condition) {
this.condition = condition;
return this;
}
/**
* Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'.
*
* @return the conditionVersion value.
*/
public String conditionVersion() {
return this.conditionVersion;
}
/**
* Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'.
*
* @param conditionVersion the conditionVersion value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withConditionVersion(String conditionVersion) {
this.conditionVersion = conditionVersion;
return this;
}
/**
* Get the createdOn property: DateTime when role assignment schedule was created.
*
* @return the createdOn value.
*/
public OffsetDateTime createdOn() {
return this.createdOn;
}
/**
* Set the createdOn property: DateTime when role assignment schedule was created.
*
* @param createdOn the createdOn value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withCreatedOn(OffsetDateTime createdOn) {
this.createdOn = createdOn;
return this;
}
/**
* Get the updatedOn property: DateTime when role assignment schedule was modified.
*
* @return the updatedOn value.
*/
public OffsetDateTime updatedOn() {
return this.updatedOn;
}
/**
* Set the updatedOn property: DateTime when role assignment schedule was modified.
*
* @param updatedOn the updatedOn value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withUpdatedOn(OffsetDateTime updatedOn) {
this.updatedOn = updatedOn;
return this;
}
/**
* Get the expandedProperties property: Additional properties of principal, scope and role definition.
*
* @return the expandedProperties value.
*/
public ExpandedProperties expandedProperties() {
return this.expandedProperties;
}
/**
* Set the expandedProperties property: Additional properties of principal, scope and role definition.
*
* @param expandedProperties the expandedProperties value to set.
* @return the RoleAssignmentScheduleProperties object itself.
*/
public RoleAssignmentScheduleProperties withExpandedProperties(ExpandedProperties expandedProperties) {
this.expandedProperties = expandedProperties;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (expandedProperties() != null) {
expandedProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("scope", this.scope);
jsonWriter.writeStringField("roleDefinitionId", this.roleDefinitionId);
jsonWriter.writeStringField("principalId", this.principalId);
jsonWriter.writeStringField("principalType", this.principalType == null ? null : this.principalType.toString());
jsonWriter.writeStringField("roleAssignmentScheduleRequestId", this.roleAssignmentScheduleRequestId);
jsonWriter.writeStringField("linkedRoleEligibilityScheduleId", this.linkedRoleEligibilityScheduleId);
jsonWriter.writeStringField("assignmentType",
this.assignmentType == null ? null : this.assignmentType.toString());
jsonWriter.writeStringField("memberType", this.memberType == null ? null : this.memberType.toString());
jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString());
jsonWriter.writeStringField("startDateTime",
this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime));
jsonWriter.writeStringField("endDateTime",
this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime));
jsonWriter.writeStringField("condition", this.condition);
jsonWriter.writeStringField("conditionVersion", this.conditionVersion);
jsonWriter.writeStringField("createdOn",
this.createdOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdOn));
jsonWriter.writeStringField("updatedOn",
this.updatedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedOn));
jsonWriter.writeJsonField("expandedProperties", this.expandedProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of RoleAssignmentScheduleProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of RoleAssignmentScheduleProperties 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 RoleAssignmentScheduleProperties.
*/
public static RoleAssignmentScheduleProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
RoleAssignmentScheduleProperties deserializedRoleAssignmentScheduleProperties
= new RoleAssignmentScheduleProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("scope".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.scope = reader.getString();
} else if ("roleDefinitionId".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.roleDefinitionId = reader.getString();
} else if ("principalId".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.principalId = reader.getString();
} else if ("principalType".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.principalType
= PrincipalType.fromString(reader.getString());
} else if ("roleAssignmentScheduleRequestId".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.roleAssignmentScheduleRequestId = reader.getString();
} else if ("linkedRoleEligibilityScheduleId".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.linkedRoleEligibilityScheduleId = reader.getString();
} else if ("assignmentType".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.assignmentType
= AssignmentType.fromString(reader.getString());
} else if ("memberType".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.memberType = MemberType.fromString(reader.getString());
} else if ("status".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.status = Status.fromString(reader.getString());
} else if ("startDateTime".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.startDateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("endDateTime".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.endDateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("condition".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.condition = reader.getString();
} else if ("conditionVersion".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.conditionVersion = reader.getString();
} else if ("createdOn".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.createdOn = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("updatedOn".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.updatedOn = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("expandedProperties".equals(fieldName)) {
deserializedRoleAssignmentScheduleProperties.expandedProperties
= ExpandedProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedRoleAssignmentScheduleProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy