Class GraphServiceClient

java.lang.Object
com.microsoft.kiota.BaseRequestBuilder
com.microsoft.graph.BaseGraphServiceClient
com.microsoft.graph.serviceclient.GraphServiceClient
All Implemented Interfaces:
com.microsoft.graph.core.requests.IBaseClient

public class GraphServiceClient extends BaseGraphServiceClient implements com.microsoft.graph.core.requests.IBaseClient
  • Constructor Details

    • GraphServiceClient

      public GraphServiceClient(@Nonnull com.microsoft.kiota.RequestAdapter requestAdapter)
      Instantiates a new GraphServiceClient and sets the default values.
      Parameters:
      requestAdapter - The request adapter to use to execute the requests.
    • GraphServiceClient

      public GraphServiceClient(@Nonnull com.microsoft.kiota.authentication.AuthenticationProvider authenticationProvider)
      Instantiate the GraphServiceClient using an AuthenticationProvider.
      Parameters:
      authenticationProvider - The AuthenticationProvider for this GraphServiceClient.
    • GraphServiceClient

      public GraphServiceClient(@Nonnull com.microsoft.kiota.authentication.AuthenticationProvider authenticationProvider, @Nonnull okhttp3.OkHttpClient client, @Nonnull com.microsoft.graph.core.requests.BaseGraphRequestAdapter.Clouds clouds)
      Instantiate the GraphServiceClient using an AuthenticationProvider, Cloud and OkHttpClient.
      Parameters:
      authenticationProvider - The AuthenticationProvider for this GraphServiceClient.
      client - The OkHttpClient for the GraphServiceClient.
      clouds - The Clouds for the GraphServiceClient.
    • GraphServiceClient

      public GraphServiceClient(@Nonnull com.microsoft.kiota.authentication.AuthenticationProvider authenticationProvider, @Nonnull okhttp3.OkHttpClient client)
      Instantiate the GraphServiceClient using an AuthenticationProvider and OkHttpClient.
      Parameters:
      authenticationProvider - The AuthenticationProvider for this GraphServiceClient.
      client - The OkHttpClient for the GraphServiceClient.
    • GraphServiceClient

      public GraphServiceClient(@Nonnull okhttp3.OkHttpClient client)
      Instantiate the GraphServiceClient using an OkHttpClient
      Parameters:
      client - The OkHttpClient for the GraphServiceClient.
    • GraphServiceClient

      public GraphServiceClient(@Nonnull com.azure.core.credential.TokenCredential tokenCredential, @Nullable String... scopes)
      Instantiate the GraphServiceClient using a TokenCredential and Scopes.
      Parameters:
      tokenCredential - The TokenCredential for this GraphServiceClient.
      scopes - The Scopes for this GraphServiceClient.
  • Method Details

    • getGraphClientOptions

      @Nonnull public static com.microsoft.graph.core.requests.options.GraphClientOption getGraphClientOptions()
      Sets a few basic values for the GraphClientOptions to pass to the client.
      Returns:
      the GraphClientOptions instance for the GraphServiceClient.
    • setRequestAdapter

      public void setRequestAdapter(@Nonnull com.microsoft.kiota.RequestAdapter requestAdapter)
      Sets the RequestAdapter for the GraphServiceClient.
      Specified by:
      setRequestAdapter in interface com.microsoft.graph.core.requests.IBaseClient
      Parameters:
      requestAdapter - the request adapter to use to execute the requests.
    • getRequestAdapter

      @Nonnull public com.microsoft.kiota.RequestAdapter getRequestAdapter()
      Gets the RequestAdapter for the GraphServiceClient.
      Specified by:
      getRequestAdapter in interface com.microsoft.graph.core.requests.IBaseClient
      Returns:
      the request adapter to use to execute the requests.
    • getBatchRequestBuilder

      @Nonnull public com.microsoft.graph.core.requests.BatchRequestBuilder getBatchRequestBuilder()
      Gets the BatchRequestBuilder for the GraphServiceClient.
      Specified by:
      getBatchRequestBuilder in interface com.microsoft.graph.core.requests.IBaseClient
      Returns:
      the BatchRequestBuilder for the GraphServiceClient.
    • me

      @Nonnull public UserItemRequestBuilder me()
      Provides operations to manage the user singleton.
      Returns:
      the request builder for the user singleton.