Class UserSecurityContext

java.lang.Object
com.azure.ai.openai.models.UserSecurityContext
All Implemented Interfaces:
com.azure.json.JsonSerializable<UserSecurityContext>

public final class UserSecurityContext extends Object implements com.azure.json.JsonSerializable<UserSecurityContext>
User security context contains several parameters that describe the AI application itself, and the end user that interacts with the AI application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. (Learn more at https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of UserSecurityContext class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of UserSecurityContext from the JsonReader.
    Get the applicationName property: The name of the application.
    Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application.
    Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to.
    Get the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.
    setApplicationName(String applicationName)
    Set the applicationName property: The name of the application.
    setEndUserId(String endUserId)
    Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application.
    setEndUserTenantId(String endUserTenantId)
    Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to.
    setSourceIp(String sourceIp)
    Set the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • UserSecurityContext

      public UserSecurityContext()
      Creates an instance of UserSecurityContext class.
  • Method Details

    • getApplicationName

      public String getApplicationName()
      Get the applicationName property: The name of the application. Sensitive personal information should not be included in this field.
      Returns:
      the applicationName value.
    • setApplicationName

      public UserSecurityContext setApplicationName(String applicationName)
      Set the applicationName property: The name of the application. Sensitive personal information should not be included in this field.
      Parameters:
      applicationName - the applicationName value to set.
      Returns:
      the UserSecurityContext object itself.
    • getEndUserId

      public String getEndUserId()
      Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.
      Returns:
      the endUserId value.
    • setEndUserId

      public UserSecurityContext setEndUserId(String endUserId)
      Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.
      Parameters:
      endUserId - the endUserId value to set.
      Returns:
      the UserSecurityContext object itself.
    • getEndUserTenantId

      public String getEndUserTenantId()
      Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multi tenant.
      Returns:
      the endUserTenantId value.
    • setEndUserTenantId

      public UserSecurityContext setEndUserTenantId(String endUserTenantId)
      Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multi tenant.
      Parameters:
      endUserTenantId - the endUserTenantId value to set.
      Returns:
      the UserSecurityContext object itself.
    • getSourceIp

      public String getSourceIp()
      Get the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.
      Returns:
      the sourceIp value.
    • setSourceIp

      public UserSecurityContext setSourceIp(String sourceIp)
      Set the sourceIp property: Captures the original client's IP address, accepting both IPv4 and IPv6 formats.
      Parameters:
      sourceIp - the sourceIp value to set.
      Returns:
      the UserSecurityContext object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<UserSecurityContext>
      Throws:
      IOException
    • fromJson

      public static UserSecurityContext fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of UserSecurityContext from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of UserSecurityContext 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 UserSecurityContext.