code: public final void setCredentials(AWSCredentialsProvider credentialsProvider) {
          this.credentials = credentialsProvider;
          
          if (null != this.iamEndpoint){
  	        if ((this.credentials.getCredentials() instanceof IBMOAuthCredentials) &&
          		((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){
          			((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).setIamEndpoint(iamEndpoint);
          			if (((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).getProvider() instanceof DefaultTokenProvider){
          				((DefaultTokenProvider)((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).getProvider()).setIamEndpoint(iamEndpoint);
          			}
  	        }
          }
          
          if (this.iamTokenRefreshOffset > 0){
  	        if ((this.credentials.getCredentials() instanceof IBMOAuthCredentials) &&
          		((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){
          			((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).setIamRefreshOffset(iamTokenRefreshOffset);
  	        }
          }
          
          if (this.iamMaxRetry > 0){
  	        if ((this.credentials.getCredentials() instanceof IBMOAuthCredentials) &&
          		((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){
          			((DefaultTokenManager)((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager()).setIamMaxRetry(iamMaxRetry);;
  	        }
          }
      }
docs: Sets the AWSCredentialsProvider used by the client. If not specified the default is {@link
  DefaultAWSCredentialsProviderChain}.
  
  @param credentialsProvider New AWSCredentialsProvider to use.