39
39
import com .google .auth .RequestMetadataCallback ;
40
40
import com .google .auth .http .HttpTransportFactory ;
41
41
import com .google .common .base .MoreObjects ;
42
+ import com .google .errorprone .annotations .CanIgnoreReturnValue ;
42
43
import java .io .IOException ;
43
44
import java .io .InputStream ;
44
45
import java .math .BigDecimal ;
@@ -395,6 +396,7 @@ public static ExternalAccountCredentials fromStream(
395
396
* @param transportFactory HTTP transport factory, creates the transport used to get access tokens
396
397
* @return the credentials defined by the JSON
397
398
*/
399
+ @ SuppressWarnings ("unchecked" )
398
400
static ExternalAccountCredentials fromJson (
399
401
Map <String , Object > json , HttpTransportFactory transportFactory ) {
400
402
checkNotNull (json );
@@ -762,6 +764,7 @@ protected Builder(ExternalAccountCredentials credentials) {
762
764
* @param transportFactory the {@code HttpTransportFactory} to set
763
765
* @return this {@code Builder} object
764
766
*/
767
+ @ CanIgnoreReturnValue
765
768
public Builder setHttpTransportFactory (HttpTransportFactory transportFactory ) {
766
769
this .transportFactory = transportFactory ;
767
770
return this ;
@@ -774,6 +777,7 @@ public Builder setHttpTransportFactory(HttpTransportFactory transportFactory) {
774
777
* @param audience the Security Token Service audience to set
775
778
* @return this {@code Builder} object
776
779
*/
780
+ @ CanIgnoreReturnValue
777
781
public Builder setAudience (String audience ) {
778
782
this .audience = audience ;
779
783
return this ;
@@ -786,6 +790,7 @@ public Builder setAudience(String audience) {
786
790
* @param subjectTokenType the Security Token Service subject token type to set
787
791
* @return this {@code Builder} object
788
792
*/
793
+ @ CanIgnoreReturnValue
789
794
public Builder setSubjectTokenType (String subjectTokenType ) {
790
795
this .subjectTokenType = subjectTokenType ;
791
796
return this ;
@@ -797,6 +802,7 @@ public Builder setSubjectTokenType(String subjectTokenType) {
797
802
* @param tokenUrl the Security Token Service token exchange url to set
798
803
* @return this {@code Builder} object
799
804
*/
805
+ @ CanIgnoreReturnValue
800
806
public Builder setTokenUrl (String tokenUrl ) {
801
807
this .tokenUrl = tokenUrl ;
802
808
return this ;
@@ -808,6 +814,7 @@ public Builder setTokenUrl(String tokenUrl) {
808
814
* @param credentialSource the {@code CredentialSource} to set
809
815
* @return this {@code Builder} object
810
816
*/
817
+ @ CanIgnoreReturnValue
811
818
public Builder setCredentialSource (CredentialSource credentialSource ) {
812
819
this .credentialSource = credentialSource ;
813
820
return this ;
@@ -821,6 +828,7 @@ public Builder setCredentialSource(CredentialSource credentialSource) {
821
828
* @param serviceAccountImpersonationUrl the service account impersonation url to set
822
829
* @return this {@code Builder} object
823
830
*/
831
+ @ CanIgnoreReturnValue
824
832
public Builder setServiceAccountImpersonationUrl (String serviceAccountImpersonationUrl ) {
825
833
this .serviceAccountImpersonationUrl = serviceAccountImpersonationUrl ;
826
834
return this ;
@@ -833,6 +841,7 @@ public Builder setServiceAccountImpersonationUrl(String serviceAccountImpersonat
833
841
* @param tokenInfoUrl the token info url to set
834
842
* @return this {@code Builder} object
835
843
*/
844
+ @ CanIgnoreReturnValue
836
845
public Builder setTokenInfoUrl (String tokenInfoUrl ) {
837
846
this .tokenInfoUrl = tokenInfoUrl ;
838
847
return this ;
@@ -844,6 +853,7 @@ public Builder setTokenInfoUrl(String tokenInfoUrl) {
844
853
* @param quotaProjectId the quota and billing project id to set
845
854
* @return this {@code Builder} object
846
855
*/
856
+ @ CanIgnoreReturnValue
847
857
public Builder setQuotaProjectId (String quotaProjectId ) {
848
858
super .setQuotaProjectId (quotaProjectId );
849
859
return this ;
@@ -855,6 +865,7 @@ public Builder setQuotaProjectId(String quotaProjectId) {
855
865
* @param clientId the service account client id to set
856
866
* @return this {@code Builder} object
857
867
*/
868
+ @ CanIgnoreReturnValue
858
869
public Builder setClientId (String clientId ) {
859
870
this .clientId = clientId ;
860
871
return this ;
@@ -866,6 +877,7 @@ public Builder setClientId(String clientId) {
866
877
* @param clientSecret the service account client secret to set
867
878
* @return this {@code Builder} object
868
879
*/
880
+ @ CanIgnoreReturnValue
869
881
public Builder setClientSecret (String clientSecret ) {
870
882
this .clientSecret = clientSecret ;
871
883
return this ;
@@ -877,6 +889,7 @@ public Builder setClientSecret(String clientSecret) {
877
889
* @param scopes the request scopes to set
878
890
* @return this {@code Builder} object
879
891
*/
892
+ @ CanIgnoreReturnValue
880
893
public Builder setScopes (Collection <String > scopes ) {
881
894
this .scopes = scopes ;
882
895
return this ;
@@ -890,6 +903,7 @@ public Builder setScopes(Collection<String> scopes) {
890
903
* @param workforcePoolUserProject the workforce pool user project number to set
891
904
* @return this {@code Builder} object
892
905
*/
906
+ @ CanIgnoreReturnValue
893
907
public Builder setWorkforcePoolUserProject (String workforcePoolUserProject ) {
894
908
this .workforcePoolUserProject = workforcePoolUserProject ;
895
909
return this ;
@@ -901,6 +915,7 @@ public Builder setWorkforcePoolUserProject(String workforcePoolUserProject) {
901
915
* @param optionsMap the service account impersonation options to set
902
916
* @return this {@code Builder} object
903
917
*/
918
+ @ CanIgnoreReturnValue
904
919
public Builder setServiceAccountImpersonationOptions (Map <String , Object > optionsMap ) {
905
920
this .serviceAccountImpersonationOptions = new ServiceAccountImpersonationOptions (optionsMap );
906
921
return this ;
@@ -912,6 +927,7 @@ public Builder setServiceAccountImpersonationOptions(Map<String, Object> options
912
927
* @param universeDomain the universe domain to set
913
928
* @return this {@code Builder} object
914
929
*/
930
+ @ CanIgnoreReturnValue
915
931
public Builder setUniverseDomain (String universeDomain ) {
916
932
this .universeDomain = universeDomain ;
917
933
return this ;
@@ -923,6 +939,7 @@ public Builder setUniverseDomain(String universeDomain) {
923
939
* @param environmentProvider the {@code EnvironmentProvider} to set
924
940
* @return this {@code Builder} object
925
941
*/
942
+ @ CanIgnoreReturnValue
926
943
Builder setEnvironmentProvider (EnvironmentProvider environmentProvider ) {
927
944
this .environmentProvider = environmentProvider ;
928
945
return this ;
0 commit comments