|
| 1 | +import { ApplyArchiveRuleCommandInput, ApplyArchiveRuleCommandOutput } from "./commands/ApplyArchiveRuleCommand"; |
| 2 | +import { |
| 3 | + CancelPolicyGenerationCommandInput, |
| 4 | + CancelPolicyGenerationCommandOutput, |
| 5 | +} from "./commands/CancelPolicyGenerationCommand"; |
| 6 | +import { |
| 7 | + CreateAccessPreviewCommandInput, |
| 8 | + CreateAccessPreviewCommandOutput, |
| 9 | +} from "./commands/CreateAccessPreviewCommand"; |
| 10 | +import { CreateAnalyzerCommandInput, CreateAnalyzerCommandOutput } from "./commands/CreateAnalyzerCommand"; |
| 11 | +import { CreateArchiveRuleCommandInput, CreateArchiveRuleCommandOutput } from "./commands/CreateArchiveRuleCommand"; |
| 12 | +import { DeleteAnalyzerCommandInput, DeleteAnalyzerCommandOutput } from "./commands/DeleteAnalyzerCommand"; |
| 13 | +import { DeleteArchiveRuleCommandInput, DeleteArchiveRuleCommandOutput } from "./commands/DeleteArchiveRuleCommand"; |
| 14 | +import { GetAccessPreviewCommandInput, GetAccessPreviewCommandOutput } from "./commands/GetAccessPreviewCommand"; |
| 15 | +import { |
| 16 | + GetAnalyzedResourceCommandInput, |
| 17 | + GetAnalyzedResourceCommandOutput, |
| 18 | +} from "./commands/GetAnalyzedResourceCommand"; |
| 19 | +import { GetAnalyzerCommandInput, GetAnalyzerCommandOutput } from "./commands/GetAnalyzerCommand"; |
| 20 | +import { GetArchiveRuleCommandInput, GetArchiveRuleCommandOutput } from "./commands/GetArchiveRuleCommand"; |
| 21 | +import { GetFindingCommandInput, GetFindingCommandOutput } from "./commands/GetFindingCommand"; |
| 22 | +import { GetGeneratedPolicyCommandInput, GetGeneratedPolicyCommandOutput } from "./commands/GetGeneratedPolicyCommand"; |
| 23 | +import { |
| 24 | + ListAccessPreviewFindingsCommandInput, |
| 25 | + ListAccessPreviewFindingsCommandOutput, |
| 26 | +} from "./commands/ListAccessPreviewFindingsCommand"; |
| 27 | +import { ListAccessPreviewsCommandInput, ListAccessPreviewsCommandOutput } from "./commands/ListAccessPreviewsCommand"; |
| 28 | +import { |
| 29 | + ListAnalyzedResourcesCommandInput, |
| 30 | + ListAnalyzedResourcesCommandOutput, |
| 31 | +} from "./commands/ListAnalyzedResourcesCommand"; |
| 32 | +import { ListAnalyzersCommandInput, ListAnalyzersCommandOutput } from "./commands/ListAnalyzersCommand"; |
| 33 | +import { ListArchiveRulesCommandInput, ListArchiveRulesCommandOutput } from "./commands/ListArchiveRulesCommand"; |
| 34 | +import { ListFindingsCommandInput, ListFindingsCommandOutput } from "./commands/ListFindingsCommand"; |
| 35 | +import { |
| 36 | + ListPolicyGenerationsCommandInput, |
| 37 | + ListPolicyGenerationsCommandOutput, |
| 38 | +} from "./commands/ListPolicyGenerationsCommand"; |
| 39 | +import { |
| 40 | + ListTagsForResourceCommandInput, |
| 41 | + ListTagsForResourceCommandOutput, |
| 42 | +} from "./commands/ListTagsForResourceCommand"; |
| 43 | +import { |
| 44 | + StartPolicyGenerationCommandInput, |
| 45 | + StartPolicyGenerationCommandOutput, |
| 46 | +} from "./commands/StartPolicyGenerationCommand"; |
| 47 | +import { StartResourceScanCommandInput, StartResourceScanCommandOutput } from "./commands/StartResourceScanCommand"; |
| 48 | +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; |
| 49 | +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; |
| 50 | +import { UpdateArchiveRuleCommandInput, UpdateArchiveRuleCommandOutput } from "./commands/UpdateArchiveRuleCommand"; |
| 51 | +import { UpdateFindingsCommandInput, UpdateFindingsCommandOutput } from "./commands/UpdateFindingsCommand"; |
| 52 | +import { ValidatePolicyCommandInput, ValidatePolicyCommandOutput } from "./commands/ValidatePolicyCommand"; |
| 53 | +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; |
| 54 | +import { |
| 55 | + EndpointsInputConfig, |
| 56 | + EndpointsResolvedConfig, |
| 57 | + RegionInputConfig, |
| 58 | + RegionResolvedConfig, |
| 59 | + resolveEndpointsConfig, |
| 60 | + resolveRegionConfig, |
| 61 | +} from "@aws-sdk/config-resolver"; |
| 62 | +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; |
| 63 | +import { |
| 64 | + HostHeaderInputConfig, |
| 65 | + HostHeaderResolvedConfig, |
| 66 | + getHostHeaderPlugin, |
| 67 | + resolveHostHeaderConfig, |
| 68 | +} from "@aws-sdk/middleware-host-header"; |
| 69 | +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; |
| 70 | +import { RetryInputConfig, RetryResolvedConfig, getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry"; |
| 71 | +import { |
| 72 | + AwsAuthInputConfig, |
| 73 | + AwsAuthResolvedConfig, |
| 74 | + getAwsAuthPlugin, |
| 75 | + resolveAwsAuthConfig, |
| 76 | +} from "@aws-sdk/middleware-signing"; |
| 77 | +import { |
| 78 | + UserAgentInputConfig, |
| 79 | + UserAgentResolvedConfig, |
| 80 | + getUserAgentPlugin, |
| 81 | + resolveUserAgentConfig, |
| 82 | +} from "@aws-sdk/middleware-user-agent"; |
| 83 | +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; |
| 84 | +import { |
| 85 | + Client as __Client, |
| 86 | + SmithyConfiguration as __SmithyConfiguration, |
| 87 | + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, |
| 88 | +} from "@aws-sdk/smithy-client"; |
| 89 | +import { |
| 90 | + Provider, |
| 91 | + RegionInfoProvider, |
| 92 | + Credentials as __Credentials, |
| 93 | + Decoder as __Decoder, |
| 94 | + Encoder as __Encoder, |
| 95 | + Hash as __Hash, |
| 96 | + HashConstructor as __HashConstructor, |
| 97 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 98 | + Logger as __Logger, |
| 99 | + Provider as __Provider, |
| 100 | + StreamCollector as __StreamCollector, |
| 101 | + UrlParser as __UrlParser, |
| 102 | + UserAgent as __UserAgent, |
| 103 | +} from "@aws-sdk/types"; |
| 104 | + |
| 105 | +export type ServiceInputTypes = |
| 106 | + | ApplyArchiveRuleCommandInput |
| 107 | + | CancelPolicyGenerationCommandInput |
| 108 | + | CreateAccessPreviewCommandInput |
| 109 | + | CreateAnalyzerCommandInput |
| 110 | + | CreateArchiveRuleCommandInput |
| 111 | + | DeleteAnalyzerCommandInput |
| 112 | + | DeleteArchiveRuleCommandInput |
| 113 | + | GetAccessPreviewCommandInput |
| 114 | + | GetAnalyzedResourceCommandInput |
| 115 | + | GetAnalyzerCommandInput |
| 116 | + | GetArchiveRuleCommandInput |
| 117 | + | GetFindingCommandInput |
| 118 | + | GetGeneratedPolicyCommandInput |
| 119 | + | ListAccessPreviewFindingsCommandInput |
| 120 | + | ListAccessPreviewsCommandInput |
| 121 | + | ListAnalyzedResourcesCommandInput |
| 122 | + | ListAnalyzersCommandInput |
| 123 | + | ListArchiveRulesCommandInput |
| 124 | + | ListFindingsCommandInput |
| 125 | + | ListPolicyGenerationsCommandInput |
| 126 | + | ListTagsForResourceCommandInput |
| 127 | + | StartPolicyGenerationCommandInput |
| 128 | + | StartResourceScanCommandInput |
| 129 | + | TagResourceCommandInput |
| 130 | + | UntagResourceCommandInput |
| 131 | + | UpdateArchiveRuleCommandInput |
| 132 | + | UpdateFindingsCommandInput |
| 133 | + | ValidatePolicyCommandInput; |
| 134 | + |
| 135 | +export type ServiceOutputTypes = |
| 136 | + | ApplyArchiveRuleCommandOutput |
| 137 | + | CancelPolicyGenerationCommandOutput |
| 138 | + | CreateAccessPreviewCommandOutput |
| 139 | + | CreateAnalyzerCommandOutput |
| 140 | + | CreateArchiveRuleCommandOutput |
| 141 | + | DeleteAnalyzerCommandOutput |
| 142 | + | DeleteArchiveRuleCommandOutput |
| 143 | + | GetAccessPreviewCommandOutput |
| 144 | + | GetAnalyzedResourceCommandOutput |
| 145 | + | GetAnalyzerCommandOutput |
| 146 | + | GetArchiveRuleCommandOutput |
| 147 | + | GetFindingCommandOutput |
| 148 | + | GetGeneratedPolicyCommandOutput |
| 149 | + | ListAccessPreviewFindingsCommandOutput |
| 150 | + | ListAccessPreviewsCommandOutput |
| 151 | + | ListAnalyzedResourcesCommandOutput |
| 152 | + | ListAnalyzersCommandOutput |
| 153 | + | ListArchiveRulesCommandOutput |
| 154 | + | ListFindingsCommandOutput |
| 155 | + | ListPolicyGenerationsCommandOutput |
| 156 | + | ListTagsForResourceCommandOutput |
| 157 | + | StartPolicyGenerationCommandOutput |
| 158 | + | StartResourceScanCommandOutput |
| 159 | + | TagResourceCommandOutput |
| 160 | + | UntagResourceCommandOutput |
| 161 | + | UpdateArchiveRuleCommandOutput |
| 162 | + | UpdateFindingsCommandOutput |
| 163 | + | ValidatePolicyCommandOutput; |
| 164 | + |
| 165 | +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { |
| 166 | + /** |
| 167 | + * The HTTP handler to use. Fetch in browser and Https in Nodejs. |
| 168 | + */ |
| 169 | + requestHandler?: __HttpHandler; |
| 170 | + |
| 171 | + /** |
| 172 | + * A constructor for a class implementing the {@link __Hash} interface |
| 173 | + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. |
| 174 | + * @internal |
| 175 | + */ |
| 176 | + sha256?: __HashConstructor; |
| 177 | + |
| 178 | + /** |
| 179 | + * The function that will be used to convert strings into HTTP endpoints. |
| 180 | + * @internal |
| 181 | + */ |
| 182 | + urlParser?: __UrlParser; |
| 183 | + |
| 184 | + /** |
| 185 | + * A function that can calculate the length of a request body. |
| 186 | + * @internal |
| 187 | + */ |
| 188 | + bodyLengthChecker?: (body: any) => number | undefined; |
| 189 | + |
| 190 | + /** |
| 191 | + * A function that converts a stream into an array of bytes. |
| 192 | + * @internal |
| 193 | + */ |
| 194 | + streamCollector?: __StreamCollector; |
| 195 | + |
| 196 | + /** |
| 197 | + * The function that will be used to convert a base64-encoded string to a byte array. |
| 198 | + * @internal |
| 199 | + */ |
| 200 | + base64Decoder?: __Decoder; |
| 201 | + |
| 202 | + /** |
| 203 | + * The function that will be used to convert binary data to a base64-encoded string. |
| 204 | + * @internal |
| 205 | + */ |
| 206 | + base64Encoder?: __Encoder; |
| 207 | + |
| 208 | + /** |
| 209 | + * The function that will be used to convert a UTF8-encoded string to a byte array. |
| 210 | + * @internal |
| 211 | + */ |
| 212 | + utf8Decoder?: __Decoder; |
| 213 | + |
| 214 | + /** |
| 215 | + * The function that will be used to convert binary data to a UTF-8 encoded string. |
| 216 | + * @internal |
| 217 | + */ |
| 218 | + utf8Encoder?: __Encoder; |
| 219 | + |
| 220 | + /** |
| 221 | + * The runtime environment. |
| 222 | + * @internal |
| 223 | + */ |
| 224 | + runtime?: string; |
| 225 | + |
| 226 | + /** |
| 227 | + * Disable dyanamically changing the endpoint of the client based on the hostPrefix |
| 228 | + * trait of an operation. |
| 229 | + */ |
| 230 | + disableHostPrefix?: boolean; |
| 231 | + |
| 232 | + /** |
| 233 | + * Value for how many times a request will be made at most in case of retry. |
| 234 | + */ |
| 235 | + maxAttempts?: number | __Provider<number>; |
| 236 | + |
| 237 | + /** |
| 238 | + * Specifies which retry algorithm to use. |
| 239 | + */ |
| 240 | + retryMode?: string | __Provider<string>; |
| 241 | + |
| 242 | + /** |
| 243 | + * Optional logger for logging debug/info/warn/error. |
| 244 | + */ |
| 245 | + logger?: __Logger; |
| 246 | + |
| 247 | + /** |
| 248 | + * Unique service identifier. |
| 249 | + * @internal |
| 250 | + */ |
| 251 | + serviceId?: string; |
| 252 | + |
| 253 | + /** |
| 254 | + * The AWS region to which this client will send requests |
| 255 | + */ |
| 256 | + region?: string | __Provider<string>; |
| 257 | + |
| 258 | + /** |
| 259 | + * Default credentials provider; Not available in browser runtime. |
| 260 | + * @internal |
| 261 | + */ |
| 262 | + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; |
| 263 | + |
| 264 | + /** |
| 265 | + * Fetch related hostname, signing name or signing region with given region. |
| 266 | + * @internal |
| 267 | + */ |
| 268 | + regionInfoProvider?: RegionInfoProvider; |
| 269 | + |
| 270 | + /** |
| 271 | + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header |
| 272 | + * @internal |
| 273 | + */ |
| 274 | + defaultUserAgentProvider?: Provider<__UserAgent>; |
| 275 | +} |
| 276 | + |
| 277 | +type AccessAnalyzerClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & |
| 278 | + ClientDefaults & |
| 279 | + RegionInputConfig & |
| 280 | + EndpointsInputConfig & |
| 281 | + RetryInputConfig & |
| 282 | + HostHeaderInputConfig & |
| 283 | + AwsAuthInputConfig & |
| 284 | + UserAgentInputConfig; |
| 285 | +/** |
| 286 | + * The configuration interface of AccessAnalyzerClient class constructor that set the region, credentials and other options. |
| 287 | + */ |
| 288 | +export interface AccessAnalyzerClientConfig extends AccessAnalyzerClientConfigType {} |
| 289 | + |
| 290 | +type AccessAnalyzerClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & |
| 291 | + Required<ClientDefaults> & |
| 292 | + RegionResolvedConfig & |
| 293 | + EndpointsResolvedConfig & |
| 294 | + RetryResolvedConfig & |
| 295 | + HostHeaderResolvedConfig & |
| 296 | + AwsAuthResolvedConfig & |
| 297 | + UserAgentResolvedConfig; |
| 298 | +/** |
| 299 | + * The resolved configuration interface of AccessAnalyzerClient class. This is resolved and normalized from the {@link AccessAnalyzerClientConfig | constructor configuration interface}. |
| 300 | + */ |
| 301 | +export interface AccessAnalyzerClientResolvedConfig extends AccessAnalyzerClientResolvedConfigType {} |
| 302 | + |
| 303 | +/** |
| 304 | + * <p>Identity and Access Management Access Analyzer helps identify potential resource-access risks by enabling you to |
| 305 | + * identify any policies that grant access to an external principal. It does this by using |
| 306 | + * logic-based reasoning to analyze resource-based policies in your Amazon Web Services environment. An |
| 307 | + * external principal can be another Amazon Web Services account, a root user, an IAM user or role, a |
| 308 | + * federated user, an Amazon Web Services service, or an anonymous user. You can also use IAM Access Analyzer to |
| 309 | + * preview and validate public and cross-account access to your resources before deploying |
| 310 | + * permissions changes. This guide describes the Identity and Access Management Access Analyzer operations that you can |
| 311 | + * call programmatically. For general information about IAM Access Analyzer, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html">Identity and Access Management Access Analyzer</a> in the <b>IAM User Guide</b>.</p> |
| 312 | + * <p>To start using IAM Access Analyzer, you first need to create an analyzer.</p> |
| 313 | + */ |
| 314 | +export class AccessAnalyzerClient extends __Client< |
| 315 | + __HttpHandlerOptions, |
| 316 | + ServiceInputTypes, |
| 317 | + ServiceOutputTypes, |
| 318 | + AccessAnalyzerClientResolvedConfig |
| 319 | +> { |
| 320 | + /** |
| 321 | + * The resolved configuration of AccessAnalyzerClient class. This is resolved and normalized from the {@link AccessAnalyzerClientConfig | constructor configuration interface}. |
| 322 | + */ |
| 323 | + readonly config: AccessAnalyzerClientResolvedConfig; |
| 324 | + |
| 325 | + constructor(configuration: AccessAnalyzerClientConfig) { |
| 326 | + let _config_0 = __getRuntimeConfig(configuration); |
| 327 | + let _config_1 = resolveRegionConfig(_config_0); |
| 328 | + let _config_2 = resolveEndpointsConfig(_config_1); |
| 329 | + let _config_3 = resolveRetryConfig(_config_2); |
| 330 | + let _config_4 = resolveHostHeaderConfig(_config_3); |
| 331 | + let _config_5 = resolveAwsAuthConfig(_config_4); |
| 332 | + let _config_6 = resolveUserAgentConfig(_config_5); |
| 333 | + super(_config_6); |
| 334 | + this.config = _config_6; |
| 335 | + this.middlewareStack.use(getRetryPlugin(this.config)); |
| 336 | + this.middlewareStack.use(getContentLengthPlugin(this.config)); |
| 337 | + this.middlewareStack.use(getHostHeaderPlugin(this.config)); |
| 338 | + this.middlewareStack.use(getLoggerPlugin(this.config)); |
| 339 | + this.middlewareStack.use(getAwsAuthPlugin(this.config)); |
| 340 | + this.middlewareStack.use(getUserAgentPlugin(this.config)); |
| 341 | + } |
| 342 | + |
| 343 | + /** |
| 344 | + * Destroy underlying resources, like sockets. It's usually not necessary to do this. |
| 345 | + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. |
| 346 | + * Otherwise, sockets might stay open for quite a long time before the server terminates them. |
| 347 | + */ |
| 348 | + destroy(): void { |
| 349 | + super.destroy(); |
| 350 | + } |
| 351 | +} |
0 commit comments