-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from amzn/move_code_from_smoke_aws_generate
Move code from smoke-aws-generate.
- Loading branch information
Showing
3 changed files
with
434 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright 2019-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). | ||
// You may not use this file except in compliance with the License. | ||
// A copy of the License is located at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
// InitializerType.swift | ||
// ServiceModelCodeGeneration | ||
// | ||
|
||
import Foundation | ||
|
||
public struct InvocationTraceContextDeclaration { | ||
public let name: String | ||
public let importPackage: String? | ||
|
||
public init(name: String, importPackage: String? = nil) { | ||
self.name = name | ||
self.importPackage = importPackage | ||
} | ||
} | ||
|
||
public enum InitializerType { | ||
case standard | ||
case forGenerator | ||
case copyInitializer | ||
case genericTraceContextType | ||
case usesDefaultReportingType(defaultInvocationTraceContext: InvocationTraceContextDeclaration) | ||
case traceContextTypeFromConfig(configurationObjectName: String) | ||
case traceContextTypeFromOperationsClient(operationsClientName: String) | ||
|
||
public var isCopyInitializer: Bool { | ||
if case .copyInitializer = self { | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
|
||
public var isGenerator: Bool { | ||
if case .forGenerator = self { | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
|
||
public var isDefaultReportingType: Bool { | ||
if case .usesDefaultReportingType = self { | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
|
||
public var isStandard: Bool { | ||
if case .standard = self { | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
} |
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,50 @@ | ||
// Copyright 2019-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). | ||
// You may not use this file except in compliance with the License. | ||
// A copy of the License is located at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
// ModelLocation.swift | ||
// ServiceModelCodeGeneration | ||
// | ||
|
||
public enum VersionRequirementType: String, Codable { | ||
case from | ||
case branch | ||
case path | ||
} | ||
|
||
public struct ModelPackageDependency { | ||
public let versionRequirementType: VersionRequirementType | ||
public let versionRequirement: String? | ||
public let packageLocation: String | ||
|
||
public init (versionRequirementType: VersionRequirementType, | ||
versionRequirement: String?, | ||
packageLocation: String) { | ||
self.versionRequirementType = versionRequirementType | ||
self.versionRequirement = versionRequirement | ||
self.packageLocation = packageLocation | ||
} | ||
} | ||
|
||
public struct ModelLocation: Codable { | ||
public let modelProductDependency: String? | ||
public let modelTargetDependency: String? | ||
public let modelFilePath: String | ||
|
||
public init (modelFilePath: String, | ||
modelProductDependency: String?, | ||
modelTargetDependency: String?) { | ||
self.modelFilePath = modelFilePath | ||
self.modelProductDependency = modelProductDependency | ||
self.modelTargetDependency = modelTargetDependency | ||
} | ||
} |
Oops, something went wrong.