/* * Copyright 2018-2023 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 com.amazonaws.services.licensemanagerusersubscriptions; import org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.internal.auth.*; import com.amazonaws.metrics.*; import com.amazonaws.regions.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.protocol.json.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.annotation.ThreadSafe; import com.amazonaws.client.AwsSyncClientParams; import com.amazonaws.client.builder.AdvancedConfig; import com.amazonaws.services.licensemanagerusersubscriptions.AWSLicenseManagerUserSubscriptionsClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.licensemanagerusersubscriptions.model.*; import com.amazonaws.services.licensemanagerusersubscriptions.model.transform.*; /** * Client for accessing AWS License Manager User Subscriptions. All service calls made using this client are blocking, * and will not return until the service call completes. *
*
* With License Manager, you can create user-based subscriptions to utilize licensed software with a per user * subscription fee on Amazon EC2 instances. *
*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSLicenseManagerUserSubscriptionsClient extends AmazonWebServiceClient implements AWSLicenseManagerUserSubscriptions { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSLicenseManagerUserSubscriptions.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "license-manager-user-subscriptions"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("application/json") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.AccessDeniedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.ValidationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.ConflictExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.ServiceQuotaExceededExceptionUnmarshaller .getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.InternalServerExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller( com.amazonaws.services.licensemanagerusersubscriptions.model.transform.ThrottlingExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass( com.amazonaws.services.licensemanagerusersubscriptions.model.AWSLicenseManagerUserSubscriptionsException.class)); public static AWSLicenseManagerUserSubscriptionsClientBuilder builder() { return AWSLicenseManagerUserSubscriptionsClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on AWS License Manager User Subscriptions using the specified * parameters. * ** All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSLicenseManagerUserSubscriptionsClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on AWS License Manager User Subscriptions using the specified * parameters. * *
* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSLicenseManagerUserSubscriptionsClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("license-manager-user-subscriptions.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/licensemanagerusersubscriptions/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/licensemanagerusersubscriptions/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *
* Associates the user to an EC2 instance to utilize user-based subscriptions. *
** Your estimated bill for charges on the number of users and related costs will take 48 hours to appear for billing * periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more * information, see Viewing your * monthly charges in the Amazon Web Services Billing User Guide. *
** Deregisters the identity provider from providing user-based subscriptions. *
* * @param deregisterIdentityProviderRequest * @return Result of the DeregisterIdentityProvider operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.DeregisterIdentityProvider * @see AWS API Documentation */ @Override public DeregisterIdentityProviderResult deregisterIdentityProvider(DeregisterIdentityProviderRequest request) { request = beforeClientExecution(request); return executeDeregisterIdentityProvider(request); } @SdkInternalApi final DeregisterIdentityProviderResult executeDeregisterIdentityProvider(DeregisterIdentityProviderRequest deregisterIdentityProviderRequest) { ExecutionContext executionContext = createExecutionContext(deregisterIdentityProviderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Disassociates the user from an EC2 instance providing user-based subscriptions. *
* * @param disassociateUserRequest * @return Result of the DisassociateUser operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.DisassociateUser * @see AWS API Documentation */ @Override public DisassociateUserResult disassociateUser(DisassociateUserRequest request) { request = beforeClientExecution(request); return executeDisassociateUser(request); } @SdkInternalApi final DisassociateUserResult executeDisassociateUser(DisassociateUserRequest disassociateUserRequest) { ExecutionContext executionContext = createExecutionContext(disassociateUserRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists the identity providers for user-based subscriptions. *
* * @param listIdentityProvidersRequest * @return Result of the ListIdentityProviders operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.ListIdentityProviders * @see AWS API Documentation */ @Override public ListIdentityProvidersResult listIdentityProviders(ListIdentityProvidersRequest request) { request = beforeClientExecution(request); return executeListIdentityProviders(request); } @SdkInternalApi final ListIdentityProvidersResult executeListIdentityProviders(ListIdentityProvidersRequest listIdentityProvidersRequest) { ExecutionContext executionContext = createExecutionContext(listIdentityProvidersRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists the EC2 instances providing user-based subscriptions. *
* * @param listInstancesRequest * @return Result of the ListInstances operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.ListInstances * @see AWS API Documentation */ @Override public ListInstancesResult listInstances(ListInstancesRequest request) { request = beforeClientExecution(request); return executeListInstances(request); } @SdkInternalApi final ListInstancesResult executeListInstances(ListInstancesRequest listInstancesRequest) { ExecutionContext executionContext = createExecutionContext(listInstancesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists the user-based subscription products available from an identity provider. *
* * @param listProductSubscriptionsRequest * @return Result of the ListProductSubscriptions operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.ListProductSubscriptions * @see AWS API Documentation */ @Override public ListProductSubscriptionsResult listProductSubscriptions(ListProductSubscriptionsRequest request) { request = beforeClientExecution(request); return executeListProductSubscriptions(request); } @SdkInternalApi final ListProductSubscriptionsResult executeListProductSubscriptions(ListProductSubscriptionsRequest listProductSubscriptionsRequest) { ExecutionContext executionContext = createExecutionContext(listProductSubscriptionsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists user associations for an identity provider. *
* * @param listUserAssociationsRequest * @return Result of the ListUserAssociations operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.ListUserAssociations * @see AWS API Documentation */ @Override public ListUserAssociationsResult listUserAssociations(ListUserAssociationsRequest request) { request = beforeClientExecution(request); return executeListUserAssociations(request); } @SdkInternalApi final ListUserAssociationsResult executeListUserAssociations(ListUserAssociationsRequest listUserAssociationsRequest) { ExecutionContext executionContext = createExecutionContext(listUserAssociationsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Registers an identity provider for user-based subscriptions. *
* * @param registerIdentityProviderRequest * @return Result of the RegisterIdentityProvider operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.RegisterIdentityProvider * @see AWS API Documentation */ @Override public RegisterIdentityProviderResult registerIdentityProvider(RegisterIdentityProviderRequest request) { request = beforeClientExecution(request); return executeRegisterIdentityProvider(request); } @SdkInternalApi final RegisterIdentityProviderResult executeRegisterIdentityProvider(RegisterIdentityProviderRequest registerIdentityProviderRequest) { ExecutionContext executionContext = createExecutionContext(registerIdentityProviderRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Starts a product subscription for a user with the specified identity provider. *
** Your estimated bill for charges on the number of users and related costs will take 48 hours to appear for billing * periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more * information, see Viewing your * monthly charges in the Amazon Web Services Billing User Guide. *
** Stops a product subscription for a user with the specified identity provider. *
* * @param stopProductSubscriptionRequest * @return Result of the StopProductSubscription operation returned by the service. * @throws ServiceQuotaExceededException * The request failed because a service quota is exceeded. * @throws ConflictException * The request couldn't be completed because it conflicted with the current state of the resource. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws ResourceNotFoundException * The resource couldn't be found. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.StopProductSubscription * @see AWS API Documentation */ @Override public StopProductSubscriptionResult stopProductSubscription(StopProductSubscriptionRequest request) { request = beforeClientExecution(request); return executeStopProductSubscription(request); } @SdkInternalApi final StopProductSubscriptionResult executeStopProductSubscription(StopProductSubscriptionRequest stopProductSubscriptionRequest) { ExecutionContext executionContext = createExecutionContext(stopProductSubscriptionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Updates additional product configuration settings for the registered identity provider. *
* * @param updateIdentityProviderSettingsRequest * @return Result of the UpdateIdentityProviderSettings operation returned by the service. * @throws ValidationException * A parameter is not valid. * @throws ThrottlingException * The request was denied because of request throttling. Retry the request. * @throws InternalServerException * An exception occurred with the service. * @throws AccessDeniedException * You don't have sufficient access to perform this action. * @sample AWSLicenseManagerUserSubscriptions.UpdateIdentityProviderSettings * @see AWS API Documentation */ @Override public UpdateIdentityProviderSettingsResult updateIdentityProviderSettings(UpdateIdentityProviderSettingsRequest request) { request = beforeClientExecution(request); return executeUpdateIdentityProviderSettings(request); } @SdkInternalApi final UpdateIdentityProviderSettingsResult executeUpdateIdentityProviderSettings(UpdateIdentityProviderSettingsRequest updateIdentityProviderSettingsRequest) { ExecutionContext executionContext = createExecutionContext(updateIdentityProviderSettingsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private