software.amazon.awssdk.services.sso.SsoClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.sso;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.SdkClient;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.regions.ServiceMetadata;
import software.amazon.awssdk.services.sso.model.GetRoleCredentialsRequest;
import software.amazon.awssdk.services.sso.model.GetRoleCredentialsResponse;
import software.amazon.awssdk.services.sso.model.InvalidRequestException;
import software.amazon.awssdk.services.sso.model.ListAccountRolesRequest;
import software.amazon.awssdk.services.sso.model.ListAccountRolesResponse;
import software.amazon.awssdk.services.sso.model.ListAccountsRequest;
import software.amazon.awssdk.services.sso.model.ListAccountsResponse;
import software.amazon.awssdk.services.sso.model.LogoutRequest;
import software.amazon.awssdk.services.sso.model.LogoutResponse;
import software.amazon.awssdk.services.sso.model.ResourceNotFoundException;
import software.amazon.awssdk.services.sso.model.SsoException;
import software.amazon.awssdk.services.sso.model.TooManyRequestsException;
import software.amazon.awssdk.services.sso.model.UnauthorizedException;
import software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable;
import software.amazon.awssdk.services.sso.paginators.ListAccountsIterable;
/**
* Service client for accessing SSO. This can be created using the static {@link #builder()} method.
*
*
* AWS Single Sign-On Portal is a web service that makes it easy for you to assign user access to AWS SSO resources such
* as the user portal. Users can get AWS account applications and roles assigned to them and get federated into the
* application.
*
*
* For general information about AWS SSO, see What is AWS Single Sign-On? in the
* AWS SSO User Guide.
*
*
* This API reference guide describes the AWS SSO Portal operations that you can call programatically and includes
* detailed information on data types and errors.
*
*
*
* AWS provides SDKs that consist of libraries and sample code for various programming languages and platforms, such as
* Java, Ruby, .Net, iOS, or Android. The SDKs provide a convenient way to create programmatic access to AWS SSO and
* other AWS services. For more information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.
*
*
*/
@Generated("software.amazon.awssdk:codegen")
public interface SsoClient extends SdkClient {
String SERVICE_NAME = "awsssoportal";
/**
* Create a {@link SsoClient} with the region loaded from the
* {@link software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain} and credentials loaded from the
* {@link software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider}.
*/
static SsoClient create() {
return builder().build();
}
/**
* Create a builder that can be used to configure and create a {@link SsoClient}.
*/
static SsoClientBuilder builder() {
return new DefaultSsoClientBuilder();
}
/**
*
* Returns the STS short-term credentials for a given role name that is assigned to the user.
*
*
* @param getRoleCredentialsRequest
* @return Result of the GetRoleCredentials operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.GetRoleCredentials
* @see AWS API
* Documentation
*/
default GetRoleCredentialsResponse getRoleCredentials(GetRoleCredentialsRequest getRoleCredentialsRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
throw new UnsupportedOperationException();
}
/**
*
* Returns the STS short-term credentials for a given role name that is assigned to the user.
*
*
*
* This is a convenience which creates an instance of the {@link GetRoleCredentialsRequest.Builder} avoiding the
* need to create one manually via {@link GetRoleCredentialsRequest#builder()}
*
*
* @param getRoleCredentialsRequest
* A {@link Consumer} that will call methods on {@link GetRoleCredentialsRequest.Builder} to create a
* request.
* @return Result of the GetRoleCredentials operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.GetRoleCredentials
* @see AWS API
* Documentation
*/
default GetRoleCredentialsResponse getRoleCredentials(Consumer getRoleCredentialsRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
return getRoleCredentials(GetRoleCredentialsRequest.builder().applyMutation(getRoleCredentialsRequest).build());
}
/**
*
* Lists all roles that are assigned to the user for a given AWS account.
*
*
* @param listAccountRolesRequest
* @return Result of the ListAccountRoles operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccountRoles
* @see AWS API
* Documentation
*/
default ListAccountRolesResponse listAccountRoles(ListAccountRolesRequest listAccountRolesRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
throw new UnsupportedOperationException();
}
/**
*
* Lists all roles that are assigned to the user for a given AWS account.
*
*
*
* This is a convenience which creates an instance of the {@link ListAccountRolesRequest.Builder} avoiding the need
* to create one manually via {@link ListAccountRolesRequest#builder()}
*
*
* @param listAccountRolesRequest
* A {@link Consumer} that will call methods on {@link ListAccountRolesRequest.Builder} to create a request.
* @return Result of the ListAccountRoles operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccountRoles
* @see AWS API
* Documentation
*/
default ListAccountRolesResponse listAccountRoles(Consumer listAccountRolesRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
return listAccountRoles(ListAccountRolesRequest.builder().applyMutation(listAccountRolesRequest).build());
}
/**
*
* Lists all roles that are assigned to the user for a given AWS account.
*
*
*
* This is a variant of {@link #listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
* for (software.amazon.awssdk.services.sso.model.ListAccountRolesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest)} operation.
*
*
* @param listAccountRolesRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccountRoles
* @see AWS API
* Documentation
*/
default ListAccountRolesIterable listAccountRolesPaginator(ListAccountRolesRequest listAccountRolesRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
throw new UnsupportedOperationException();
}
/**
*
* Lists all roles that are assigned to the user for a given AWS account.
*
*
*
* This is a variant of {@link #listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
* for (software.amazon.awssdk.services.sso.model.ListAccountRolesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountRolesIterable responses = client.listAccountRolesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAccountRoles(software.amazon.awssdk.services.sso.model.ListAccountRolesRequest)} operation.
*
*
* This is a convenience which creates an instance of the {@link ListAccountRolesRequest.Builder} avoiding the need
* to create one manually via {@link ListAccountRolesRequest#builder()}
*
*
* @param listAccountRolesRequest
* A {@link Consumer} that will call methods on {@link ListAccountRolesRequest.Builder} to create a request.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccountRoles
* @see AWS API
* Documentation
*/
default ListAccountRolesIterable listAccountRolesPaginator(Consumer listAccountRolesRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
return listAccountRolesPaginator(ListAccountRolesRequest.builder().applyMutation(listAccountRolesRequest).build());
}
/**
*
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account.
* For more information, see Assign User
* Access in the AWS SSO User Guide. This operation returns a paginated response.
*
*
* @param listAccountsRequest
* @return Result of the ListAccounts operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccounts
* @see AWS API
* Documentation
*/
default ListAccountsResponse listAccounts(ListAccountsRequest listAccountsRequest) throws InvalidRequestException,
UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException,
SsoException {
throw new UnsupportedOperationException();
}
/**
*
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account.
* For more information, see Assign User
* Access in the AWS SSO User Guide. This operation returns a paginated response.
*
*
*
* This is a convenience which creates an instance of the {@link ListAccountsRequest.Builder} avoiding the need to
* create one manually via {@link ListAccountsRequest#builder()}
*
*
* @param listAccountsRequest
* A {@link Consumer} that will call methods on {@link ListAccountsRequest.Builder} to create a request.
* @return Result of the ListAccounts operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccounts
* @see AWS API
* Documentation
*/
default ListAccountsResponse listAccounts(Consumer listAccountsRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
return listAccounts(ListAccountsRequest.builder().applyMutation(listAccountsRequest).build());
}
/**
*
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account.
* For more information, see Assign User
* Access in the AWS SSO User Guide. This operation returns a paginated response.
*
*
*
* This is a variant of {@link #listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
* for (software.amazon.awssdk.services.sso.model.ListAccountsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest)} operation.
*
*
* @param listAccountsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccounts
* @see AWS API
* Documentation
*/
default ListAccountsIterable listAccountsPaginator(ListAccountsRequest listAccountsRequest) throws InvalidRequestException,
UnauthorizedException, TooManyRequestsException, ResourceNotFoundException, AwsServiceException, SdkClientException,
SsoException {
throw new UnsupportedOperationException();
}
/**
*
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account.
* For more information, see Assign User
* Access in the AWS SSO User Guide. This operation returns a paginated response.
*
*
*
* This is a variant of {@link #listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
* for (software.amazon.awssdk.services.sso.model.ListAccountsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.sso.paginators.ListAccountsIterable responses = client.listAccountsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAccounts(software.amazon.awssdk.services.sso.model.ListAccountsRequest)} operation.
*
*
* This is a convenience which creates an instance of the {@link ListAccountsRequest.Builder} avoiding the need to
* create one manually via {@link ListAccountsRequest#builder()}
*
*
* @param listAccountsRequest
* A {@link Consumer} that will call methods on {@link ListAccountsRequest.Builder} to create a request.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws ResourceNotFoundException
* The specified resource doesn't exist.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.ListAccounts
* @see AWS API
* Documentation
*/
default ListAccountsIterable listAccountsPaginator(Consumer listAccountsRequest)
throws InvalidRequestException, UnauthorizedException, TooManyRequestsException, ResourceNotFoundException,
AwsServiceException, SdkClientException, SsoException {
return listAccountsPaginator(ListAccountsRequest.builder().applyMutation(listAccountsRequest).build());
}
/**
*
* Removes the client- and server-side session that is associated with the user.
*
*
* @param logoutRequest
* @return Result of the Logout operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.Logout
* @see AWS API
* Documentation
*/
default LogoutResponse logout(LogoutRequest logoutRequest) throws InvalidRequestException, UnauthorizedException,
TooManyRequestsException, AwsServiceException, SdkClientException, SsoException {
throw new UnsupportedOperationException();
}
/**
*
* Removes the client- and server-side session that is associated with the user.
*
*
*
* This is a convenience which creates an instance of the {@link LogoutRequest.Builder} avoiding the need to create
* one manually via {@link LogoutRequest#builder()}
*
*
* @param logoutRequest
* A {@link Consumer} that will call methods on {@link LogoutRequest.Builder} to create a request.
* @return Result of the Logout operation returned by the service.
* @throws InvalidRequestException
* Indicates that a problem occurred with the input to the request. For example, a required parameter might
* be missing or out of range.
* @throws UnauthorizedException
* Indicates that the request is not authorized. This can happen due to an invalid access token in the
* request.
* @throws TooManyRequestsException
* Indicates that the request is being made too frequently and is more than what the server can handle.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SsoException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SsoClient.Logout
* @see AWS API
* Documentation
*/
default LogoutResponse logout(Consumer logoutRequest) throws InvalidRequestException,
UnauthorizedException, TooManyRequestsException, AwsServiceException, SdkClientException, SsoException {
return logout(LogoutRequest.builder().applyMutation(logoutRequest).build());
}
static ServiceMetadata serviceMetadata() {
return ServiceMetadata.of("portal.sso");
}
}