17
17
18
18
using IBM . Cloud . SDK . Utilities ;
19
19
using System ;
20
- using System . Collections . Generic ;
21
-
20
+ using System . Collections . Generic ;
21
+
22
22
namespace IBM . Cloud . SDK
23
23
{
24
24
public class BaseService
@@ -40,7 +40,7 @@ public BaseService(string serviceId)
40
40
}
41
41
}
42
42
43
- string ApiKey = Environment . GetEnvironmentVariable ( serviceId . ToUpper ( ) + "_APIKEY " ) ;
43
+ string ApiKey = Environment . GetEnvironmentVariable ( serviceId . ToUpper ( ) + "_IAM_APIKEY " ) ;
44
44
string Username = Environment . GetEnvironmentVariable ( serviceId . ToUpper ( ) + "_USERNAME" ) ;
45
45
string Password = Environment . GetEnvironmentVariable ( serviceId . ToUpper ( ) + "_PASSWORD" ) ;
46
46
string ServiceUrl = Environment . GetEnvironmentVariable ( serviceId . ToUpper ( ) + "_URL" ) ;
@@ -78,36 +78,36 @@ public BaseService(string versionDate, Credentials credentials, string serviceId
78
78
79
79
public BaseService ( Credentials credentials , string serviceId ) { }
80
80
81
- public void WithHeader ( string name , string value )
81
+ public void WithHeader ( string name , string value )
82
82
{
83
- if ( ! customRequestHeaders . ContainsKey ( name ) )
84
- {
85
- customRequestHeaders . Add ( name , value ) ;
83
+ if ( ! customRequestHeaders . ContainsKey ( name ) )
84
+ {
85
+ customRequestHeaders . Add ( name , value ) ;
86
+ }
87
+ else
88
+ {
89
+ customRequestHeaders [ name ] = value ;
86
90
}
87
- else
88
- {
89
- customRequestHeaders [ name ] = value ;
90
- }
91
91
}
92
92
93
- public void WithHeaders ( Dictionary < string , string > headers )
93
+ public void WithHeaders ( Dictionary < string , string > headers )
94
94
{
95
- foreach ( KeyValuePair < string , string > kvp in headers )
95
+ foreach ( KeyValuePair < string , string > kvp in headers )
96
96
{
97
- if ( ! customRequestHeaders . ContainsKey ( kvp . Key ) )
98
- {
99
- customRequestHeaders . Add ( kvp . Key , kvp . Value ) ;
97
+ if ( ! customRequestHeaders . ContainsKey ( kvp . Key ) )
98
+ {
99
+ customRequestHeaders . Add ( kvp . Key , kvp . Value ) ;
100
100
}
101
- else
102
- {
103
- customRequestHeaders [ kvp . Key ] = kvp . Value ;
104
- }
105
- }
101
+ else
102
+ {
103
+ customRequestHeaders [ kvp . Key ] = kvp . Value ;
104
+ }
105
+ }
106
106
}
107
107
108
- protected void ClearCustomRequestHeaders ( )
109
- {
110
- customRequestHeaders = new Dictionary < string , string > ( ) ;
108
+ protected void ClearCustomRequestHeaders ( )
109
+ {
110
+ customRequestHeaders = new Dictionary < string , string > ( ) ;
111
111
}
112
112
}
113
113
}
0 commit comments