Class AddKeyRequestBuilder

java.lang.Object
com.microsoft.kiota.BaseRequestBuilder
com.microsoft.graph.serviceprincipals.item.addkey.AddKeyRequestBuilder

@Generated("com.microsoft.kiota") public class AddKeyRequestBuilder extends com.microsoft.kiota.BaseRequestBuilder
Provides operations to call the addKey method.
  • Constructor Details

    • AddKeyRequestBuilder

      public AddKeyRequestBuilder(@Nonnull HashMap<String,Object> pathParameters, @Nonnull com.microsoft.kiota.RequestAdapter requestAdapter)
      Instantiates a new AddKeyRequestBuilder and sets the default values.
      Parameters:
      pathParameters - Path parameters for the request
      requestAdapter - The request adapter to use to execute the requests.
    • AddKeyRequestBuilder

      public AddKeyRequestBuilder(@Nonnull String rawUrl, @Nonnull com.microsoft.kiota.RequestAdapter requestAdapter)
      Instantiates a new AddKeyRequestBuilder and sets the default values.
      Parameters:
      rawUrl - The raw URL to use for the request builder.
      requestAdapter - The request adapter to use to execute the requests.
  • Method Details

    • post

      @Nullable public KeyCredential post(@Nonnull AddKeyPostRequestBody body)
      Adds a key credential to a servicePrincipal. This method along with removeKey can be used by a servicePrincipal to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. ServicePrincipals that dont have any existing valid certificates (i.e.: no certificates have been added yet, or all certificates have expired), wont be able to use this service action. Update servicePrincipal can be used to perform an update instead.
      Parameters:
      body - The request body
      Returns:
      a KeyCredential
      Throws:
      ODataError - When receiving a 4XX or 5XX status code
      See Also:
    • post

      @Nullable public KeyCredential post(@Nonnull AddKeyPostRequestBody body, @Nullable Consumer<AddKeyRequestBuilder.PostRequestConfiguration> requestConfiguration)
      Adds a key credential to a servicePrincipal. This method along with removeKey can be used by a servicePrincipal to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. ServicePrincipals that dont have any existing valid certificates (i.e.: no certificates have been added yet, or all certificates have expired), wont be able to use this service action. Update servicePrincipal can be used to perform an update instead.
      Parameters:
      body - The request body
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a KeyCredential
      Throws:
      ODataError - When receiving a 4XX or 5XX status code
      See Also:
    • toPostRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toPostRequestInformation(@Nonnull AddKeyPostRequestBody body)
      Adds a key credential to a servicePrincipal. This method along with removeKey can be used by a servicePrincipal to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. ServicePrincipals that dont have any existing valid certificates (i.e.: no certificates have been added yet, or all certificates have expired), wont be able to use this service action. Update servicePrincipal can be used to perform an update instead.
      Parameters:
      body - The request body
      Returns:
      a RequestInformation
    • toPostRequestInformation

      @Nonnull public com.microsoft.kiota.RequestInformation toPostRequestInformation(@Nonnull AddKeyPostRequestBody body, @Nullable Consumer<AddKeyRequestBuilder.PostRequestConfiguration> requestConfiguration)
      Adds a key credential to a servicePrincipal. This method along with removeKey can be used by a servicePrincipal to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. ServicePrincipals that dont have any existing valid certificates (i.e.: no certificates have been added yet, or all certificates have expired), wont be able to use this service action. Update servicePrincipal can be used to perform an update instead.
      Parameters:
      body - The request body
      requestConfiguration - Configuration for the request such as headers, query parameters, and middleware options.
      Returns:
      a RequestInformation
    • withUrl

      @Nonnull public AddKeyRequestBuilder withUrl(@Nonnull String rawUrl)
      Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
      Parameters:
      rawUrl - The raw URL to use for the request builder.
      Returns:
      a AddKeyRequestBuilder