-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
336 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...are/amazon/awssdk/codegen/poet/builder/test-client-builder-internal-user-agent-class.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package software.amazon.awssdk.services.json; | ||
|
||
import java.util.List; | ||
import software.amazon.awssdk.annotations.Generated; | ||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.auth.signer.Aws4Signer; | ||
import software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder; | ||
import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
import software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory; | ||
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; | ||
import software.amazon.awssdk.core.signer.Signer; | ||
import software.amazon.awssdk.utils.CollectionUtils; | ||
|
||
/** | ||
* Internal base class for {@link DefaultJsonClientBuilder} and {@link DefaultJsonAsyncClientBuilder}. | ||
*/ | ||
@Generated("software.amazon.awssdk:codegen") | ||
@SdkInternalApi | ||
abstract class DefaultJsonBaseClientBuilder<B extends JsonBaseClientBuilder<B, C>, C> extends AwsDefaultClientBuilder<B, C> { | ||
@Override | ||
protected final String serviceEndpointPrefix() { | ||
return "json-service-endpoint"; | ||
} | ||
|
||
@Override | ||
protected final String serviceName() { | ||
return "Json"; | ||
} | ||
|
||
@Override | ||
protected final SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration config) { | ||
return config.merge(c -> c.option(SdkAdvancedClientOption.SIGNER, defaultSigner()).option( | ||
SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED, false)); | ||
} | ||
|
||
@Override | ||
protected final SdkClientConfiguration mergeInternalDefaults(SdkClientConfiguration config) { | ||
return config.merge(c -> c.option(SdkClientOption.INTERNAL_USER_AGENT, "md/foobar")); | ||
} | ||
|
||
@Override | ||
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) { | ||
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory(); | ||
List<ExecutionInterceptor> interceptors = interceptorFactory | ||
.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors"); | ||
interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS)); | ||
return config.toBuilder().option(SdkClientOption.EXECUTION_INTERCEPTORS, interceptors).build(); | ||
} | ||
|
||
private Signer defaultSigner() { | ||
return Aws4Signer.create(); | ||
} | ||
|
||
@Override | ||
protected final String signingName() { | ||
return "json-service"; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ources/software/amazon/awssdk/codegen/poet/client/c2j/internalconfig/customization.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"authPolicyActions" : { | ||
"skip" : true | ||
}, | ||
"userAgent": "md/foobar" | ||
} |
37 changes: 37 additions & 0 deletions
37
...st/resources/software/amazon/awssdk/codegen/poet/client/c2j/internalconfig/service-2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"version": "2.0", | ||
"metadata": { | ||
"apiVersion": "2010-05-08", | ||
"endpointPrefix": "json-service-endpoint", | ||
"globalEndpoint": "json-service.amazonaws.com", | ||
"protocol": "rest-json", | ||
"serviceAbbreviation": "Json Service", | ||
"serviceFullName": "Some Service That Uses Json Protocol", | ||
"serviceId": "Json Service", | ||
"signingName": "json-service", | ||
"signatureVersion": "v4", | ||
"uid": "json-service-2010-05-08", | ||
"xmlNamespace": "https://json-service.amazonaws.com/doc/2010-05-08/" | ||
}, | ||
"operations":{ | ||
"OneOperation":{ | ||
"name":"OneOperation", | ||
"http":{ | ||
"method":"POST", | ||
"requestUri":"/2016-03-11/oneoperation" | ||
}, | ||
"input":{"shape":"OneShape"} | ||
} | ||
}, | ||
"shapes": { | ||
"OneShape": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String" | ||
} | ||
} | ||
}, | ||
"String":{"type":"string"} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...lasses-test/src/main/resources/codegen-resources/customizeduseragent/customization.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"userAgent":"md/foobar" | ||
} |
37 changes: 37 additions & 0 deletions
37
...ated-classes-test/src/main/resources/codegen-resources/customizeduseragent/service-2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"version":"2.0", | ||
"metadata":{ | ||
"apiVersion":"2016-03-11", | ||
"endpointPrefix":"internalconfig", | ||
"jsonVersion":"1.1", | ||
"protocol":"rest-json", | ||
"serviceAbbreviation":"AmazonProtocolRestJson", | ||
"serviceFullName":"Amazon Protocol Rest Json", | ||
"serviceId":"AmazonProtocolRestJsonWithInternalConfig", | ||
"signatureVersion":"v4", | ||
"targetPrefix":"ProtocolTestsService", | ||
"timestampFormat":"unixTimestamp", | ||
"uid":"restjson-2016-03-11" | ||
}, | ||
"operations":{ | ||
"OneOperation":{ | ||
"name":"OneOperation", | ||
"http":{ | ||
"method":"POST", | ||
"requestUri":"/2016-03-11/oneoperation" | ||
}, | ||
"input":{"shape":"OneShape"} | ||
} | ||
}, | ||
"shapes": { | ||
"OneShape": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String" | ||
} | ||
} | ||
}, | ||
"String":{"type":"string"} | ||
} | ||
} |
Oops, something went wrong.