com.microsoft.graph.generated.models.OAuth2PermissionGrant Maven / Gradle / Ivy
package com.microsoft.graph.models;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@jakarta.annotation.Generated("com.microsoft.kiota")
public class OAuth2PermissionGrant extends Entity implements Parsable {
/**
* Instantiates a new {@link OAuth2PermissionGrant} and sets the default values.
*/
public OAuth2PermissionGrant() {
super();
}
/**
* Creates a new instance of the appropriate class based on discriminator value
* @param parseNode The parse node to use to read the discriminator value and create the object
* @return a {@link OAuth2PermissionGrant}
*/
@jakarta.annotation.Nonnull
public static OAuth2PermissionGrant createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
return new OAuth2PermissionGrant();
}
/**
* Gets the clientId property value. The object id (not appId) of the client service principal for the application that's authorized to act on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only).
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getClientId() {
return this.backingStore.get("clientId");
}
/**
* Gets the consentType property value. Indicates if authorization is granted for the client application to impersonate all users or only a specific user. AllPrincipals indicates authorization to impersonate all users. Principal indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an administrator. Nonadmin users might be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. Supports $filter (eq only).
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getConsentType() {
return this.backingStore.get("consentType");
}
/**
* The deserialization information for the current model
* @return a {@link Map>}
*/
@jakarta.annotation.Nonnull
public Map> getFieldDeserializers() {
final HashMap> deserializerMap = new HashMap>(super.getFieldDeserializers());
deserializerMap.put("clientId", (n) -> { this.setClientId(n.getStringValue()); });
deserializerMap.put("consentType", (n) -> { this.setConsentType(n.getStringValue()); });
deserializerMap.put("principalId", (n) -> { this.setPrincipalId(n.getStringValue()); });
deserializerMap.put("resourceId", (n) -> { this.setResourceId(n.getStringValue()); });
deserializerMap.put("scope", (n) -> { this.setScope(n.getStringValue()); });
return deserializerMap;
}
/**
* Gets the principalId property value. The id of the user on behalf of whom the client is authorized to access the resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when consentType is Principal. Supports $filter (eq only).
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getPrincipalId() {
return this.backingStore.get("principalId");
}
/**
* Gets the resourceId property value. The id of the resource service principal to which access is authorized. This identifies the API that the client is authorized to attempt to call on behalf of a signed-in user. Supports $filter (eq only).
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getResourceId() {
return this.backingStore.get("resourceId");
}
/**
* Gets the scope property value. A space-separated list of the claim values for delegated permissions that should be included in access tokens for the resource application (the API). For example, openid User.Read GroupMember.Read.All. Each claim value should match the value field of one of the delegated permissions defined by the API, listed in the oauth2PermissionScopes property of the resource service principal. Must not exceed 3,850 characters in length.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getScope() {
return this.backingStore.get("scope");
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
public void serialize(@jakarta.annotation.Nonnull final SerializationWriter writer) {
Objects.requireNonNull(writer);
super.serialize(writer);
writer.writeStringValue("clientId", this.getClientId());
writer.writeStringValue("consentType", this.getConsentType());
writer.writeStringValue("principalId", this.getPrincipalId());
writer.writeStringValue("resourceId", this.getResourceId());
writer.writeStringValue("scope", this.getScope());
}
/**
* Sets the clientId property value. The object id (not appId) of the client service principal for the application that's authorized to act on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only).
* @param value Value to set for the clientId property.
*/
public void setClientId(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("clientId", value);
}
/**
* Sets the consentType property value. Indicates if authorization is granted for the client application to impersonate all users or only a specific user. AllPrincipals indicates authorization to impersonate all users. Principal indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an administrator. Nonadmin users might be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. Supports $filter (eq only).
* @param value Value to set for the consentType property.
*/
public void setConsentType(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("consentType", value);
}
/**
* Sets the principalId property value. The id of the user on behalf of whom the client is authorized to access the resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when consentType is Principal. Supports $filter (eq only).
* @param value Value to set for the principalId property.
*/
public void setPrincipalId(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("principalId", value);
}
/**
* Sets the resourceId property value. The id of the resource service principal to which access is authorized. This identifies the API that the client is authorized to attempt to call on behalf of a signed-in user. Supports $filter (eq only).
* @param value Value to set for the resourceId property.
*/
public void setResourceId(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("resourceId", value);
}
/**
* Sets the scope property value. A space-separated list of the claim values for delegated permissions that should be included in access tokens for the resource application (the API). For example, openid User.Read GroupMember.Read.All. Each claim value should match the value field of one of the delegated permissions defined by the API, listed in the oauth2PermissionScopes property of the resource service principal. Must not exceed 3,850 characters in length.
* @param value Value to set for the scope property.
*/
public void setScope(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("scope", value);
}
}