com.microsoft.graph.beta.generated.models.OAuth2PermissionGrant Maven / Gradle / Ivy
package com.microsoft.graph.beta.models;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.time.OffsetDateTime;
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 is 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 whether 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 may 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");
}
/**
* Gets the expiryTime property value. Currently, the end time value is ignored, but a value is required when creating an oAuth2PermissionGrant. Required.
* @return a {@link OffsetDateTime}
*/
@jakarta.annotation.Nullable
public OffsetDateTime getExpiryTime() {
return this.backingStore.get("expiryTime");
}
/**
* 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("expiryTime", (n) -> { this.setExpiryTime(n.getOffsetDateTimeValue()); });
deserializerMap.put("principalId", (n) -> { this.setPrincipalId(n.getStringValue()); });
deserializerMap.put("resourceId", (n) -> { this.setResourceId(n.getStringValue()); });
deserializerMap.put("scope", (n) -> { this.setScope(n.getStringValue()); });
deserializerMap.put("startTime", (n) -> { this.setStartTime(n.getOffsetDateTimeValue()); });
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 publishedPermissionScopes property of the resource service principal. Must not exceed 3850 characters in length.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getScope() {
return this.backingStore.get("scope");
}
/**
* Gets the startTime property value. Currently, the start time value is ignored, but a value is required when creating an oAuth2PermissionGrant. Required.
* @return a {@link OffsetDateTime}
*/
@jakarta.annotation.Nullable
public OffsetDateTime getStartTime() {
return this.backingStore.get("startTime");
}
/**
* 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.writeOffsetDateTimeValue("expiryTime", this.getExpiryTime());
writer.writeStringValue("principalId", this.getPrincipalId());
writer.writeStringValue("resourceId", this.getResourceId());
writer.writeStringValue("scope", this.getScope());
writer.writeOffsetDateTimeValue("startTime", this.getStartTime());
}
/**
* Sets the clientId property value. The object id (not appId) of the client service principal for the application that is 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 whether 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 may 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 expiryTime property value. Currently, the end time value is ignored, but a value is required when creating an oAuth2PermissionGrant. Required.
* @param value Value to set for the expiryTime property.
*/
public void setExpiryTime(@jakarta.annotation.Nullable final OffsetDateTime value) {
this.backingStore.set("expiryTime", 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 publishedPermissionScopes property of the resource service principal. Must not exceed 3850 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);
}
/**
* Sets the startTime property value. Currently, the start time value is ignored, but a value is required when creating an oAuth2PermissionGrant. Required.
* @param value Value to set for the startTime property.
*/
public void setStartTime(@jakarta.annotation.Nullable final OffsetDateTime value) {
this.backingStore.set("startTime", value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy