/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.managedgrafana.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains the instructions for one Grafana role permission update in a UpdatePermissions * operation. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateInstruction implements Serializable, Cloneable, StructuredPojo { /** ** Specifies whether this update is to add or revoke role permissions. *
*/ private String action; /** *
* The role to add or revoke for the user or the group specified in users
.
*
* A structure that specifies the user or group to add or revoke the role for. *
*/ private java.util.List* Specifies whether this update is to add or revoke role permissions. *
* * @param action * Specifies whether this update is to add or revoke role permissions. * @see UpdateAction */ public void setAction(String action) { this.action = action; } /** ** Specifies whether this update is to add or revoke role permissions. *
* * @return Specifies whether this update is to add or revoke role permissions. * @see UpdateAction */ public String getAction() { return this.action; } /** ** Specifies whether this update is to add or revoke role permissions. *
* * @param action * Specifies whether this update is to add or revoke role permissions. * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateAction */ public UpdateInstruction withAction(String action) { setAction(action); return this; } /** ** Specifies whether this update is to add or revoke role permissions. *
* * @param action * Specifies whether this update is to add or revoke role permissions. * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateAction */ public UpdateInstruction withAction(UpdateAction action) { this.action = action.toString(); return this; } /** *
* The role to add or revoke for the user or the group specified in users
.
*
users
.
* @see Role
*/
public void setRole(String role) {
this.role = role;
}
/**
*
* The role to add or revoke for the user or the group specified in users
.
*
users
.
* @see Role
*/
public String getRole() {
return this.role;
}
/**
*
* The role to add or revoke for the user or the group specified in users
.
*
users
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Role
*/
public UpdateInstruction withRole(String role) {
setRole(role);
return this;
}
/**
*
* The role to add or revoke for the user or the group specified in users
.
*
users
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Role
*/
public UpdateInstruction withRole(Role role) {
this.role = role.toString();
return this;
}
/**
* * A structure that specifies the user or group to add or revoke the role for. *
* * @return A structure that specifies the user or group to add or revoke the role for. */ public java.util.List* A structure that specifies the user or group to add or revoke the role for. *
* * @param users * A structure that specifies the user or group to add or revoke the role for. */ public void setUsers(java.util.Collection* A structure that specifies the user or group to add or revoke the role for. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setUsers(java.util.Collection)} or {@link #withUsers(java.util.Collection)} if you want to override the * existing values. *
* * @param users * A structure that specifies the user or group to add or revoke the role for. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateInstruction withUsers(User... users) { if (this.users == null) { setUsers(new java.util.ArrayList* A structure that specifies the user or group to add or revoke the role for. *
* * @param users * A structure that specifies the user or group to add or revoke the role for. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateInstruction withUsers(java.util.Collection