import * as HttpClient from "effect/unstable/http/HttpClient";
import * as redacted from "effect/Redacted";
import * as S from "effect/Schema";
import * as stream from "effect/Stream";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import * as C from "../category.js";
import { SensitiveString } from "../sensitive.js";
const svc = T.AwsApiService({ sdkId: "Ssm Sap", serviceShapeName: "SsmSap" });
const auth = T.AwsAuthSigv4({ name: "ssm-sap" });
const ver = T.ServiceVersion("2018-05-10");
const proto = T.AwsProtocolsRestJson1();
const rules = T.EndpointResolver((p, _) => {
    const { Region, UseDualStack = false, UseFIPS = false, Endpoint } = p;
    const e = (u, p = {}, h = {}) => ({
        type: "endpoint",
        endpoint: { url: u, properties: p, headers: h },
    });
    const err = (m) => ({
        type: "error",
        message: m,
    });
    if (Endpoint != null) {
        if (UseFIPS === true) {
            return err("Invalid Configuration: FIPS and custom endpoint are not supported");
        }
        if (UseDualStack === true) {
            return err("Invalid Configuration: Dualstack and custom endpoint are not supported");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (UseFIPS === true && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsFIPS") &&
                        true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://ssm-sap-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("FIPS and DualStack are enabled, but this partition does not support one or both");
                }
                if (UseFIPS === true) {
                    if (_.getAttr(PartitionResult, "supportsFIPS") === true) {
                        return e(`https://ssm-sap-fips.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                    }
                    return err("FIPS is enabled but this partition does not support FIPS");
                }
                if (UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://ssm-sap.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://ssm-sap.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const PermissionActionType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DeleteResourcePermissionInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ActionType: S.optional(PermissionActionType),
    SourceResourceArn: S.optional(S.String),
    ResourceArn: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/delete-resource-permission" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteResourcePermissionInput",
});
export const DeleteResourcePermissionOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Policy: S.optional(S.String) })).annotate({
    identifier: "DeleteResourcePermissionOutput",
});
export const DeregisterApplicationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ApplicationId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/deregister-application" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeregisterApplicationInput",
});
export const DeregisterApplicationOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeregisterApplicationOutput",
});
export const GetApplicationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    ApplicationArn: S.optional(S.String),
    AppRegistryArn: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/get-application" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetApplicationInput",
});
export const ApplicationType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ApplicationStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ApplicationDiscoveryStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ComponentIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ApplicationArnList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Application = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(S.String),
    Type: S.optional(ApplicationType),
    Arn: S.optional(S.String),
    AppRegistryArn: S.optional(S.String),
    Status: S.optional(ApplicationStatus),
    DiscoveryStatus: S.optional(ApplicationDiscoveryStatus),
    Components: S.optional(ComponentIdList),
    LastUpdated: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    StatusMessage: S.optional(S.String),
    AssociatedApplicationArns: S.optional(ApplicationArnList),
})).annotate({ identifier: "Application" });
export const TagMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const GetApplicationOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Application: S.optional(Application), Tags: S.optional(TagMap) })).annotate({
    identifier: "GetApplicationOutput",
});
export const GetComponentInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ApplicationId: S.String, ComponentId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/get-component" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetComponentInput",
});
export const ComponentType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ComponentStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ReplicationMode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const OperationMode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ClusterStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Resilience = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    HsrTier: S.optional(S.String),
    HsrReplicationMode: S.optional(ReplicationMode),
    HsrOperationMode: S.optional(OperationMode),
    ClusterStatus: S.optional(ClusterStatus),
    EnqueueReplication: S.optional(S.Boolean),
})).annotate({ identifier: "Resilience" });
export const AllocationType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const IpAddressMember = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IpAddress: S.optional(S.String),
    Primary: S.optional(S.Boolean),
    AllocationType: S.optional(AllocationType),
})).annotate({
    identifier: "IpAddressMember",
});
export const IpAddressList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(IpAddressMember);
export const AssociatedHost = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Hostname: S.optional(S.String),
    Ec2InstanceId: S.optional(S.String),
    IpAddresses: S.optional(IpAddressList),
    OsVersion: S.optional(S.String),
})).annotate({ identifier: "AssociatedHost" });
export const DatabaseIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const HostRole = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Host = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    HostName: S.optional(S.String),
    HostIp: S.optional(S.String),
    EC2InstanceId: S.optional(S.String),
    InstanceId: S.optional(S.String),
    HostRole: S.optional(HostRole),
    OsVersion: S.optional(S.String),
})).annotate({ identifier: "Host" });
export const HostList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Host);
export const DatabaseConnectionMethod = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DatabaseConnection = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    DatabaseConnectionMethod: S.optional(DatabaseConnectionMethod),
    DatabaseArn: S.optional(S.String),
    ConnectionIp: S.optional(S.String),
})).annotate({
    identifier: "DatabaseConnection",
});
export const Component = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ComponentId: S.optional(S.String),
    Sid: S.optional(S.String),
    SystemNumber: S.optional(S.String),
    ParentComponent: S.optional(S.String),
    ChildComponents: S.optional(ComponentIdList),
    ApplicationId: S.optional(S.String),
    ComponentType: S.optional(ComponentType),
    Status: S.optional(ComponentStatus),
    SapHostname: S.optional(S.String),
    SapFeature: S.optional(S.String),
    SapKernelVersion: S.optional(S.String),
    HdbVersion: S.optional(S.String),
    Resilience: S.optional(Resilience),
    AssociatedHost: S.optional(AssociatedHost),
    Databases: S.optional(DatabaseIdList),
    Hosts: S.optional(HostList),
    PrimaryHost: S.optional(S.String),
    DatabaseConnection: S.optional(DatabaseConnection),
    LastUpdated: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    Arn: S.optional(S.String),
})).annotate({ identifier: "Component" });
export const GetComponentOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Component: S.optional(Component), Tags: S.optional(TagMap) })).annotate({
    identifier: "GetComponentOutput",
});
export const GetConfigurationCheckOperationInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ OperationId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/get-configuration-check-operation" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetConfigurationCheckOperationInput",
});
export const OperationStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ConfigurationCheckType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const RuleStatusCounts = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Failed: S.optional(S.Number),
    Warning: S.optional(S.Number),
    Info: S.optional(S.Number),
    Passed: S.optional(S.Number),
    Unknown: S.optional(S.Number),
})).annotate({
    identifier: "RuleStatusCounts",
});
export const ConfigurationCheckOperation = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(S.String),
    ApplicationId: S.optional(S.String),
    Status: S.optional(OperationStatus),
    StatusMessage: S.optional(S.String),
    ConfigurationCheckId: S.optional(ConfigurationCheckType),
    ConfigurationCheckName: S.optional(S.String),
    ConfigurationCheckDescription: S.optional(S.String),
    StartTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    EndTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    RuleStatusCounts: S.optional(RuleStatusCounts),
})).annotate({
    identifier: "ConfigurationCheckOperation",
});
export const GetConfigurationCheckOperationOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ConfigurationCheckOperation: S.optional(ConfigurationCheckOperation),
})).annotate({
    identifier: "GetConfigurationCheckOperationOutput",
});
export const GetDatabaseInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    ComponentId: S.optional(S.String),
    DatabaseId: S.optional(S.String),
    DatabaseArn: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/get-database" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetDatabaseInput",
});
export const CredentialType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ApplicationCredential = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    DatabaseName: S.String,
    CredentialType: CredentialType,
    SecretId: SensitiveString,
})).annotate({
    identifier: "ApplicationCredential",
});
export const ApplicationCredentialList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ApplicationCredential);
export const DatabaseType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DatabaseStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ComponentArnList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Database = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    ComponentId: S.optional(S.String),
    Credentials: S.optional(ApplicationCredentialList),
    DatabaseId: S.optional(S.String),
    DatabaseName: S.optional(S.String),
    DatabaseType: S.optional(DatabaseType),
    Arn: S.optional(S.String),
    Status: S.optional(DatabaseStatus),
    PrimaryHost: S.optional(S.String),
    SQLPort: S.optional(S.Number),
    LastUpdated: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    ConnectedComponentArns: S.optional(ComponentArnList),
})).annotate({ identifier: "Database" });
export const GetDatabaseOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Database: S.optional(Database), Tags: S.optional(TagMap) })).annotate({
    identifier: "GetDatabaseOutput",
});
export const GetOperationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ OperationId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/get-operation" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetOperationInput",
});
export const OperationProperties = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional)).pipe(T.Sparse());
export const Operation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(S.String),
    Type: S.optional(S.String),
    Status: S.optional(OperationStatus),
    StatusMessage: S.optional(S.String),
    Properties: S.optional(OperationProperties),
    ResourceType: S.optional(S.String),
    ResourceId: S.optional(S.String),
    ResourceArn: S.optional(S.String),
    StartTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    EndTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    LastUpdatedTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({ identifier: "Operation" });
export const GetOperationOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Operation: S.optional(Operation) })).annotate({
    identifier: "GetOperationOutput",
});
export const GetResourcePermissionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ActionType: S.optional(PermissionActionType),
    ResourceArn: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/get-resource-permission" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetResourcePermissionInput",
});
export const GetResourcePermissionOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Policy: S.optional(S.String) })).annotate({
    identifier: "GetResourcePermissionOutput",
});
export const FilterOperator = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Filter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: S.String, Value: S.String, Operator: FilterOperator })).annotate({ identifier: "Filter" });
export const FilterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Filter);
export const ListApplicationsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    MaxResults: S.optional(S.Number),
    Filters: S.optional(FilterList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-applications" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListApplicationsInput",
});
export const ApplicationSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(S.String),
    DiscoveryStatus: S.optional(ApplicationDiscoveryStatus),
    Type: S.optional(ApplicationType),
    Arn: S.optional(S.String),
    Tags: S.optional(TagMap),
})).annotate({
    identifier: "ApplicationSummary",
});
export const ApplicationSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ApplicationSummary);
export const ListApplicationsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Applications: S.optional(ApplicationSummaryList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListApplicationsOutput",
});
export const ListComponentsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    NextToken: S.optional(S.String),
    MaxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-components" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListComponentsInput",
});
export const ComponentSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    ComponentId: S.optional(S.String),
    ComponentType: S.optional(ComponentType),
    Tags: S.optional(TagMap),
    Arn: S.optional(S.String),
})).annotate({
    identifier: "ComponentSummary",
});
export const ComponentSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ComponentSummary);
export const ListComponentsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Components: S.optional(ComponentSummaryList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListComponentsOutput",
});
export const ListConfigurationCheckDefinitionsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/list-configuration-check-definitions",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListConfigurationCheckDefinitionsInput",
});
export const ApplicationTypeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ApplicationType);
export const ConfigurationCheckDefinition = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(ConfigurationCheckType),
    Name: S.optional(S.String),
    Description: S.optional(S.String),
    ApplicableApplicationTypes: S.optional(ApplicationTypeList),
})).annotate({
    identifier: "ConfigurationCheckDefinition",
});
export const ConfigurationCheckDefinitionList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ConfigurationCheckDefinition);
export const ListConfigurationCheckDefinitionsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ConfigurationChecks: S.optional(ConfigurationCheckDefinitionList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListConfigurationCheckDefinitionsOutput",
});
export const ConfigurationCheckOperationListingMode = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const ListConfigurationCheckOperationsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.String,
    ListMode: S.optional(ConfigurationCheckOperationListingMode),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    Filters: S.optional(FilterList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-configuration-check-operations" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListConfigurationCheckOperationsInput",
});
export const ConfigurationCheckOperationList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ConfigurationCheckOperation);
export const ListConfigurationCheckOperationsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ConfigurationCheckOperations: S.optional(ConfigurationCheckOperationList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListConfigurationCheckOperationsOutput",
});
export const ListDatabasesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    ComponentId: S.optional(S.String),
    NextToken: S.optional(S.String),
    MaxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-databases" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListDatabasesInput",
});
export const DatabaseSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.optional(S.String),
    ComponentId: S.optional(S.String),
    DatabaseId: S.optional(S.String),
    DatabaseType: S.optional(DatabaseType),
    Arn: S.optional(S.String),
    Tags: S.optional(TagMap),
})).annotate({
    identifier: "DatabaseSummary",
});
export const DatabaseSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(DatabaseSummary);
export const ListDatabasesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Databases: S.optional(DatabaseSummaryList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListDatabasesOutput",
});
export const ListOperationEventsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    OperationId: S.String,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    Filters: S.optional(FilterList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-operation-events" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListOperationEventsInput",
});
export const Resource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.optional(S.String),
    ResourceType: S.optional(S.String),
})).annotate({ identifier: "Resource" });
export const OperationEventStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const OperationEvent = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Description: S.optional(S.String),
    Resource: S.optional(Resource),
    Status: S.optional(OperationEventStatus),
    StatusMessage: S.optional(S.String),
    Timestamp: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({ identifier: "OperationEvent" });
export const OperationEventList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(OperationEvent);
export const ListOperationEventsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    OperationEvents: S.optional(OperationEventList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListOperationEventsOutput",
});
export const ListOperationsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.String,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    Filters: S.optional(FilterList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-operations" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListOperationsInput",
});
export const OperationList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Operation);
export const ListOperationsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Operations: S.optional(OperationList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListOperationsOutput",
});
export const ListSubCheckResultsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    OperationId: S.String,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-sub-check-results" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListSubCheckResultsInput",
});
export const SubCheckReferencesList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const SubCheckResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(S.String),
    Name: S.optional(S.String),
    Description: S.optional(S.String),
    References: S.optional(SubCheckReferencesList),
})).annotate({ identifier: "SubCheckResult" });
export const SubCheckResultList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SubCheckResult);
export const ListSubCheckResultsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    SubCheckResults: S.optional(SubCheckResultList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListSubCheckResultsOutput",
});
export const ListSubCheckRuleResultsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    SubCheckResultId: S.String,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-sub-check-rule-results" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListSubCheckRuleResultsInput",
});
export const RuleResultStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const RuleResultMetadata = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const RuleResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Id: S.optional(S.String),
    Description: S.optional(S.String),
    Status: S.optional(RuleResultStatus),
    Message: S.optional(S.String),
    Metadata: S.optional(RuleResultMetadata),
})).annotate({ identifier: "RuleResult" });
export const RuleResultList = /*@__PURE__*/ /*#__PURE__*/ S.Array(RuleResult);
export const ListSubCheckRuleResultsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    RuleResults: S.optional(RuleResultList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListSubCheckRuleResultsOutput",
});
export const ListTagsForResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ resourceArn: S.String.pipe(T.HttpLabel("resourceArn")) }).pipe(T.all(T.Http({ method: "GET", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListTagsForResourceRequest",
});
export const ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tags: S.optional(TagMap) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const PutResourcePermissionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ActionType: PermissionActionType,
    SourceResourceArn: S.String,
    ResourceArn: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/put-resource-permission" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "PutResourcePermissionInput",
});
export const PutResourcePermissionOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Policy: S.optional(S.String) })).annotate({
    identifier: "PutResourcePermissionOutput",
});
export const InstanceList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ComponentInfo = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ComponentType: ComponentType,
    Sid: S.String,
    Ec2InstanceId: S.String,
})).annotate({ identifier: "ComponentInfo" });
export const ComponentInfoList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ComponentInfo);
export const RegisterApplicationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.String,
    ApplicationType: ApplicationType,
    Instances: InstanceList,
    SapInstanceNumber: S.optional(S.String),
    Sid: S.optional(S.String),
    Tags: S.optional(TagMap),
    Credentials: S.optional(ApplicationCredentialList),
    DatabaseArn: S.optional(S.String),
    ComponentsInfo: S.optional(ComponentInfoList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/register-application" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "RegisterApplicationInput",
});
export const RegisterApplicationOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Application: S.optional(Application),
    OperationId: S.optional(S.String),
})).annotate({
    identifier: "RegisterApplicationOutput",
});
export const StartApplicationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ApplicationId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/start-application" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartApplicationInput",
});
export const StartApplicationOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ OperationId: S.optional(S.String) })).annotate({
    identifier: "StartApplicationOutput",
});
export const StartApplicationRefreshInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ApplicationId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/start-application-refresh" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartApplicationRefreshInput",
});
export const StartApplicationRefreshOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ OperationId: S.optional(S.String) })).annotate({
    identifier: "StartApplicationRefreshOutput",
});
export const ConfigurationCheckTypeList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ConfigurationCheckType);
export const StartConfigurationChecksInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.String,
    ConfigurationCheckIds: S.optional(ConfigurationCheckTypeList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/start-configuration-checks" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartConfigurationChecksInput",
});
export const StartConfigurationChecksOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ConfigurationCheckOperations: S.optional(ConfigurationCheckOperationList),
})).annotate({
    identifier: "StartConfigurationChecksOutput",
});
export const ConnectedEntityType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const StopApplicationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.String,
    StopConnectedEntity: S.optional(ConnectedEntityType),
    IncludeEc2InstanceShutdown: S.optional(S.Boolean),
}).pipe(T.all(T.Http({ method: "POST", uri: "/stop-application" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StopApplicationInput",
});
export const StopApplicationOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ OperationId: S.optional(S.String) })).annotate({
    identifier: "StopApplicationOutput",
});
export const TagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String.pipe(T.HttpLabel("resourceArn")),
    tags: TagMap,
}).pipe(T.all(T.Http({ method: "POST", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "TagResourceRequest",
});
export const TagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "TagResourceResponse",
});
export const TagKeyList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String.pipe(T.HttpLabel("resourceArn")),
    tagKeys: TagKeyList.pipe(T.HttpQuery("tagKeys")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UntagResourceRequest",
});
export const UntagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UntagResourceResponse",
});
export const BackintMode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const BackintConfig = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ BackintMode: BackintMode, EnsureNoBackupInProcess: S.Boolean })).annotate({ identifier: "BackintConfig" });
export const UpdateApplicationSettingsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApplicationId: S.String,
    CredentialsToAddOrUpdate: S.optional(ApplicationCredentialList),
    CredentialsToRemove: S.optional(ApplicationCredentialList),
    Backint: S.optional(BackintConfig),
    DatabaseArn: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/update-application-settings" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateApplicationSettingsInput",
});
export const OperationIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UpdateApplicationSettingsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Message: S.optional(S.String),
    OperationIds: S.optional(OperationIdList),
})).annotate({
    identifier: "UpdateApplicationSettingsOutput",
});
//# Errors
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { Message: S.optional(S.String) }).pipe(C.withServerError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { Message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { Message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class UnauthorizedException extends S.TaggedErrorClass()("UnauthorizedException", { Message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { Message: S.optional(S.String) }).pipe(C.withConflictError) {
}
/**
 * Removes permissions associated with the target database.
 */
export const deleteResourcePermission = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteResourcePermissionInput,
    output: DeleteResourcePermissionOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Deregister an SAP application with AWS Systems Manager for SAP. This action does not aﬀect the existing setup of your SAP workloads on Amazon EC2.
 */
export const deregisterApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeregisterApplicationInput,
    output: DeregisterApplicationOutput,
    errors: [InternalServerException, UnauthorizedException, ValidationException],
}));
/**
 * Gets an application registered with AWS Systems Manager for SAP. It also returns the components of the application.
 */
export const getApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetApplicationInput,
    output: GetApplicationOutput,
    errors: [InternalServerException, ValidationException],
}));
/**
 * Gets the component of an application registered with AWS Systems Manager for SAP.
 */
export const getComponent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetComponentInput,
    output: GetComponentOutput,
    errors: [InternalServerException, UnauthorizedException, ValidationException],
}));
/**
 * Gets the details of a configuration check operation by specifying the operation ID.
 */
export const getConfigurationCheckOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetConfigurationCheckOperationInput,
    output: GetConfigurationCheckOperationOutput,
    errors: [InternalServerException, ValidationException],
}));
/**
 * Gets the SAP HANA database of an application registered with AWS Systems Manager for SAP.
 */
export const getDatabase = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDatabaseInput,
    output: GetDatabaseOutput,
    errors: [InternalServerException, ValidationException],
}));
/**
 * Gets the details of an operation by specifying the operation ID.
 */
export const getOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOperationInput,
    output: GetOperationOutput,
    errors: [InternalServerException, ValidationException],
}));
/**
 * Gets permissions associated with the target database.
 */
export const getResourcePermission = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetResourcePermissionInput,
    output: GetResourcePermissionOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Lists all the applications registered with AWS Systems Manager for SAP.
 */
export const listApplications = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListApplicationsInput,
    output: ListApplicationsOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Applications",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists all the components registered with AWS Systems Manager for SAP.
 */
export const listComponents = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListComponentsInput,
    output: ListComponentsOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        UnauthorizedException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Components",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists all configuration check types supported by AWS Systems Manager for SAP.
 */
export const listConfigurationCheckDefinitions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListConfigurationCheckDefinitionsInput,
    output: ListConfigurationCheckDefinitionsOutput,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "ConfigurationChecks",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists the configuration check operations performed by AWS Systems Manager for SAP.
 */
export const listConfigurationCheckOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListConfigurationCheckOperationsInput,
    output: ListConfigurationCheckOperationsOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "ConfigurationCheckOperations",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists the SAP HANA databases of an application registered with AWS Systems Manager for SAP.
 */
export const listDatabases = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListDatabasesInput,
    output: ListDatabasesOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Databases",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of operations events.
 *
 * Available parameters include `OperationID`, as well as optional parameters `MaxResults`, `NextToken`, and `Filters`.
 */
export const listOperationEvents = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListOperationEventsInput,
    output: ListOperationEventsOutput,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "OperationEvents",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists the operations performed by AWS Systems Manager for SAP.
 */
export const listOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListOperationsInput,
    output: ListOperationsOutput,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Operations",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists the sub-check results of a specified configuration check operation.
 */
export const listSubCheckResults = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSubCheckResultsInput,
    output: ListSubCheckResultsOutput,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "SubCheckResults",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists the rules of a specified sub-check belonging to a configuration check operation.
 */
export const listSubCheckRuleResults = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSubCheckRuleResultsInput,
    output: ListSubCheckRuleResultsOutput,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "RuleResults",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists all tags on an SAP HANA application and/or database registered with AWS Systems Manager for SAP.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [ConflictException, ResourceNotFoundException, ValidationException],
}));
/**
 * Adds permissions to the target database.
 */
export const putResourcePermission = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutResourcePermissionInput,
    output: PutResourcePermissionOutput,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Register an SAP application with AWS Systems Manager for SAP. You must meet the following requirements before registering.
 *
 * The SAP application you want to register with AWS Systems Manager for SAP is running on Amazon EC2.
 *
 * AWS Systems Manager Agent must be setup on an Amazon EC2 instance along with the required IAM permissions.
 *
 * Amazon EC2 instance(s) must have access to the secrets created in AWS Secrets Manager to manage SAP applications and components.
 */
export const registerApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RegisterApplicationInput,
    output: RegisterApplicationOutput,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Request is an operation which starts an application.
 *
 * Parameter `ApplicationId` is required.
 */
export const startApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartApplicationInput,
    output: StartApplicationOutput,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Refreshes a registered application.
 */
export const startApplicationRefresh = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartApplicationRefreshInput,
    output: StartApplicationRefreshOutput,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Initiates configuration check operations against a specified application.
 */
export const startConfigurationChecks = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartConfigurationChecksInput,
    output: StartConfigurationChecksOutput,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Request is an operation to stop an application.
 *
 * Parameter `ApplicationId` is required. Parameters `StopConnectedEntity` and `IncludeEc2InstanceShutdown` are optional.
 */
export const stopApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StopApplicationInput,
    output: StopApplicationOutput,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Creates tag for a resource by specifying the ARN.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [ConflictException, ResourceNotFoundException, ValidationException],
}));
/**
 * Delete the tags for a resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [ConflictException, ResourceNotFoundException, ValidationException],
}));
/**
 * Updates the settings of an application registered with AWS Systems Manager for SAP.
 */
export const updateApplicationSettings = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateApplicationSettingsInput,
    output: UpdateApplicationSettingsOutput,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        UnauthorizedException,
        ValidationException,
    ],
}));
//# sourceMappingURL=ssm-sap.js.map