Skip to content

Commit

Permalink
Merge pull request #95 from amzn/report_client_name
Browse files Browse the repository at this point in the history
Specify the client name for reporting purposes.
  • Loading branch information
tachyonics authored Sep 2, 2023
2 parents 74c7cea + bfe37f4 commit f16a4fa
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,12 @@ extension ModelClientDelegate {
httpClientConfiguration: HttpClientConfiguration,
codeGenerator: ServiceModelCodeGenerator<ModelType, TargetSupportType>,
entityType: ClientEntityType) {
if entityType.isClientImplementation {
fileBuilder.appendLine("""
public let clientName = "\(baseName)Client"
""")
}

if entityType.isClientImplementation || entityType.isGenerator {
fileBuilder.appendLine("""
let httpClient: HTTPOperationsClient
Expand Down Expand Up @@ -712,6 +718,12 @@ extension ModelClientDelegate {
codeGenerator: ServiceModelCodeGenerator<ModelType, TargetSupportType>,
targetsAPIGateway: Bool,
entityType: ClientEntityType) {
if entityType.isClientImplementation {
fileBuilder.appendLine("""
public let clientName = "\(baseName)Client"
""")
}

if entityType.isClientImplementation || entityType.isGenerator {
fileBuilder.appendLine("""
let httpClient: HTTPOperationsClient
Expand Down Expand Up @@ -952,7 +964,7 @@ extension ModelClientDelegate {
fileBuilder.appendLine("""
connectionPoolConfiguration: HTTPClient.Configuration.ConnectionPool? = nil,
retryConfiguration: HTTPClientRetryConfiguration = .default,
eventLoopProvider: HTTPClient.EventLoopGroupProvider = .createNew,
eventLoopProvider: HTTPClient.EventLoopGroupProvider = .singleton,
reportingConfiguration: HTTPClientReportingConfiguration<\(baseName)ModelOperations>
""")

Expand Down

0 comments on commit f16a4fa

Please sign in to comment.