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: "Marketplace Agreement",
    serviceShapeName: "AWSMPCommerceService_v20200301",
});
const auth = T.AwsAuthSigv4({ name: "aws-marketplace" });
const ver = T.ServiceVersion("2020-03-01");
const proto = T.AwsProtocolsAwsJson1_0();
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://agreement-marketplace-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://agreement-marketplace-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://agreement-marketplace.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://agreement-marketplace.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const BillingAdjustmentReasonCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const BatchCreateBillingAdjustmentRequestEntry = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.String,
    originalInvoiceId: S.String,
    adjustmentAmount: S.String,
    currencyCode: S.String,
    adjustmentReasonCode: BillingAdjustmentReasonCode,
    description: S.optional(SensitiveString),
    clientToken: S.String,
})).annotate({
    identifier: "BatchCreateBillingAdjustmentRequestEntry",
});
export const BatchCreateBillingAdjustmentRequestEntryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(BatchCreateBillingAdjustmentRequestEntry);
export const BatchCreateBillingAdjustmentRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    billingAdjustmentRequestEntries: BatchCreateBillingAdjustmentRequestEntryList,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "BatchCreateBillingAdjustmentRequestInput",
});
export const BatchCreateBillingAdjustmentItem = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ billingAdjustmentRequestId: S.String, clientToken: S.String })).annotate({
    identifier: "BatchCreateBillingAdjustmentItem",
});
export const BatchCreateBillingAdjustmentItemList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(BatchCreateBillingAdjustmentItem);
export const BillingAdjustmentErrorCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const BatchCreateBillingAdjustmentError = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    code: BillingAdjustmentErrorCode,
    message: S.String,
    clientToken: S.String,
})).annotate({
    identifier: "BatchCreateBillingAdjustmentError",
});
export const BatchCreateBillingAdjustmentErrorList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(BatchCreateBillingAdjustmentError);
export const BatchCreateBillingAdjustmentRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    items: BatchCreateBillingAdjustmentItemList,
    errors: BatchCreateBillingAdjustmentErrorList,
})).annotate({
    identifier: "BatchCreateBillingAdjustmentRequestOutput",
});
export const ResourceType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ValidationExceptionReason = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ValidationExceptionField = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ name: S.String, message: S.String })).annotate({
    identifier: "ValidationExceptionField",
});
export const ValidationExceptionFieldList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ValidationExceptionField);
export const CancelAgreementCancellationRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.String,
    agreementCancellationRequestId: S.String,
    cancellationReason: SensitiveString,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CancelAgreementCancellationRequestInput",
});
export const AgreementCancellationRequestReasonCode = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const AgreementCancellationRequestStatus = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const CancelAgreementCancellationRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementCancellationRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    reasonCode: S.optional(AgreementCancellationRequestReasonCode),
    description: S.optional(SensitiveString),
    status: S.optional(AgreementCancellationRequestStatus),
    statusMessage: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "CancelAgreementCancellationRequestOutput",
});
export const CancelAgreementPaymentRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ paymentRequestId: S.String, agreementId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CancelAgreementPaymentRequestInput",
});
export const PaymentRequestStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CancelAgreementPaymentRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    paymentRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    status: S.optional(PaymentRequestStatus),
    name: S.optional(S.String),
    description: S.optional(SensitiveString),
    chargeAmount: S.optional(S.String),
    currencyCode: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "CancelAgreementPaymentRequestOutput",
});
export const DescribeAgreementInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ agreementId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeAgreementInput",
});
export const Acceptor = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ accountId: S.optional(S.String) })).annotate({ identifier: "Acceptor" });
export const Proposer = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ accountId: S.optional(S.String) })).annotate({ identifier: "Proposer" });
export const EstimatedCharges = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    currencyCode: S.optional(S.String),
    agreementValue: S.optional(S.String),
})).annotate({
    identifier: "EstimatedCharges",
});
export const Resource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.String), type: S.optional(S.String) })).annotate({ identifier: "Resource" });
export const Resources = /*@__PURE__*/ /*#__PURE__*/ S.Array(Resource);
export const ProposalSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resources: S.optional(Resources),
    offerId: S.optional(S.String),
    offerSetId: S.optional(S.String),
})).annotate({
    identifier: "ProposalSummary",
});
export const AgreementStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DescribeAgreementOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.optional(S.String),
    acceptor: S.optional(Acceptor),
    proposer: S.optional(Proposer),
    startTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    endTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    acceptanceTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    agreementType: S.optional(S.String),
    estimatedCharges: S.optional(EstimatedCharges),
    proposalSummary: S.optional(ProposalSummary),
    status: S.optional(AgreementStatus),
})).annotate({
    identifier: "DescribeAgreementOutput",
});
export const GetAgreementCancellationRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementCancellationRequestId: S.String,
    agreementId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAgreementCancellationRequestInput",
});
export const GetAgreementCancellationRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementCancellationRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    reasonCode: S.optional(AgreementCancellationRequestReasonCode),
    description: S.optional(SensitiveString),
    status: S.optional(AgreementCancellationRequestStatus),
    statusMessage: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "GetAgreementCancellationRequestOutput",
});
export const GetAgreementPaymentRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ paymentRequestId: S.String, agreementId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAgreementPaymentRequestInput",
});
export const GetAgreementPaymentRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    paymentRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    status: S.optional(PaymentRequestStatus),
    statusMessage: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(SensitiveString),
    chargeId: S.optional(S.String),
    chargeAmount: S.optional(S.String),
    currencyCode: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "GetAgreementPaymentRequestOutput",
});
export const GetAgreementTermsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.String,
    maxResults: S.optional(S.Number),
    nextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAgreementTermsInput",
});
export const DocumentItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    url: S.optional(S.String),
    version: S.optional(S.String),
})).annotate({ identifier: "DocumentItem" });
export const DocumentList = /*@__PURE__*/ /*#__PURE__*/ S.Array(DocumentItem);
export const LegalTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: S.optional(S.String), documents: S.optional(DocumentList) })).annotate({ identifier: "LegalTerm" });
export const SupportTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: S.optional(S.String), refundPolicy: S.optional(S.String) })).annotate({ identifier: "SupportTerm" });
export const RenewalTermConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ enableAutoRenew: S.Boolean })).annotate({
    identifier: "RenewalTermConfiguration",
});
export const RenewalTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    configuration: S.optional(RenewalTermConfiguration),
})).annotate({ identifier: "RenewalTerm" });
export const RateCardItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ dimensionKey: S.optional(S.String), price: S.optional(S.String) })).annotate({ identifier: "RateCardItem" });
export const RateCardList = /*@__PURE__*/ /*#__PURE__*/ S.Array(RateCardItem);
export const UsageBasedRateCardItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ rateCard: S.optional(RateCardList) })).annotate({
    identifier: "UsageBasedRateCardItem",
});
export const UsageBasedRateCardList = /*@__PURE__*/ /*#__PURE__*/ S.Array(UsageBasedRateCardItem);
export const UsageBasedPricingTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    currencyCode: S.optional(S.String),
    rateCards: S.optional(UsageBasedRateCardList),
})).annotate({
    identifier: "UsageBasedPricingTerm",
});
export const Selector = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: S.optional(S.String), value: S.optional(S.String) })).annotate({ identifier: "Selector" });
export const Constraints = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    multipleDimensionSelection: S.optional(S.String),
    quantityConfiguration: S.optional(S.String),
})).annotate({ identifier: "Constraints" });
export const ConfigurableUpfrontRateCardItem = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    selector: S.optional(Selector),
    constraints: S.optional(Constraints),
    rateCard: S.optional(RateCardList),
})).annotate({
    identifier: "ConfigurableUpfrontRateCardItem",
});
export const ConfigurableUpfrontRateCardList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ConfigurableUpfrontRateCardItem);
export const Dimension = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ dimensionKey: S.String, dimensionValue: S.Number })).annotate({ identifier: "Dimension" });
export const DimensionList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Dimension);
export const ConfigurableUpfrontPricingTermConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ selectorValue: S.String, dimensions: DimensionList })).annotate({
    identifier: "ConfigurableUpfrontPricingTermConfiguration",
});
export const ConfigurableUpfrontPricingTerm = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    currencyCode: S.optional(S.String),
    rateCards: S.optional(ConfigurableUpfrontRateCardList),
    configuration: S.optional(ConfigurableUpfrontPricingTermConfiguration),
})).annotate({
    identifier: "ConfigurableUpfrontPricingTerm",
});
export const ByolPricingTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: S.optional(S.String) })).annotate({
    identifier: "ByolPricingTerm",
});
export const RecurringPaymentTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    currencyCode: S.optional(S.String),
    billingPeriod: S.optional(S.String),
    price: S.optional(S.String),
})).annotate({
    identifier: "RecurringPaymentTerm",
});
export const ValidityTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    agreementDuration: S.optional(S.String),
    agreementStartDate: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    agreementEndDate: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({ identifier: "ValidityTerm" });
export const ScheduleItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    chargeDate: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    chargeAmount: S.optional(S.String),
})).annotate({ identifier: "ScheduleItem" });
export const ScheduleList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ScheduleItem);
export const PaymentScheduleTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    currencyCode: S.optional(S.String),
    schedule: S.optional(ScheduleList),
})).annotate({
    identifier: "PaymentScheduleTerm",
});
export const GrantItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    dimensionKey: S.optional(S.String),
    maxQuantity: S.optional(S.Number),
})).annotate({ identifier: "GrantItem" });
export const GrantList = /*@__PURE__*/ /*#__PURE__*/ S.Array(GrantItem);
export const FreeTrialPricingTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    duration: S.optional(S.String),
    grants: S.optional(GrantList),
})).annotate({
    identifier: "FreeTrialPricingTerm",
});
export const FixedUpfrontPricingTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    currencyCode: S.optional(S.String),
    duration: S.optional(S.String),
    price: S.optional(S.String),
    grants: S.optional(GrantList),
})).annotate({
    identifier: "FixedUpfrontPricingTerm",
});
export const PaymentRequestApprovalStrategy = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const VariablePaymentTermConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    paymentRequestApprovalStrategy: PaymentRequestApprovalStrategy,
    expirationDuration: S.optional(S.String),
})).annotate({
    identifier: "VariablePaymentTermConfiguration",
});
export const VariablePaymentTerm = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: S.optional(S.String),
    currencyCode: S.optional(S.String),
    maxTotalChargeAmount: S.optional(S.String),
    configuration: S.optional(VariablePaymentTermConfiguration),
})).annotate({
    identifier: "VariablePaymentTerm",
});
export const AcceptedTerm = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ legalTerm: LegalTerm }),
    S.Struct({ supportTerm: SupportTerm }),
    S.Struct({ renewalTerm: RenewalTerm }),
    S.Struct({ usageBasedPricingTerm: UsageBasedPricingTerm }),
    S.Struct({ configurableUpfrontPricingTerm: ConfigurableUpfrontPricingTerm }),
    S.Struct({ byolPricingTerm: ByolPricingTerm }),
    S.Struct({ recurringPaymentTerm: RecurringPaymentTerm }),
    S.Struct({ validityTerm: ValidityTerm }),
    S.Struct({ paymentScheduleTerm: PaymentScheduleTerm }),
    S.Struct({ freeTrialPricingTerm: FreeTrialPricingTerm }),
    S.Struct({ fixedUpfrontPricingTerm: FixedUpfrontPricingTerm }),
    S.Struct({ variablePaymentTerm: VariablePaymentTerm }),
]);
export const AcceptedTermList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AcceptedTerm);
export const GetAgreementTermsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    acceptedTerms: S.optional(AcceptedTermList),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "GetAgreementTermsOutput",
});
export const GetBillingAdjustmentRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.String,
    billingAdjustmentRequestId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetBillingAdjustmentRequestInput",
});
export const BillingAdjustmentStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GetBillingAdjustmentRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    billingAdjustmentRequestId: S.String,
    agreementId: S.String,
    adjustmentReasonCode: BillingAdjustmentReasonCode,
    description: S.optional(S.String),
    originalInvoiceId: S.String,
    adjustmentAmount: S.String,
    currencyCode: S.String,
    status: BillingAdjustmentStatus,
    statusMessage: S.optional(S.String),
    createdAt: S.Date.pipe(T.TimestampFormat("epoch-seconds")),
    updatedAt: S.Date.pipe(T.TimestampFormat("epoch-seconds")),
})).annotate({
    identifier: "GetBillingAdjustmentRequestOutput",
});
export const ListAgreementCancellationRequestsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    partyType: S.String,
    agreementId: S.optional(S.String),
    status: S.optional(AgreementCancellationRequestStatus),
    agreementType: S.optional(S.String),
    catalog: S.optional(S.String),
    maxResults: S.optional(S.Number),
    nextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAgreementCancellationRequestsInput",
});
export const AgreementCancellationRequestSummary = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementCancellationRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    status: S.optional(AgreementCancellationRequestStatus),
    reasonCode: S.optional(AgreementCancellationRequestReasonCode),
    agreementType: S.optional(S.String),
    catalog: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "AgreementCancellationRequestSummary",
});
export const AgreementCancellationRequestSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AgreementCancellationRequestSummary);
export const ListAgreementCancellationRequestsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String),
    items: S.optional(AgreementCancellationRequestSummaryList),
})).annotate({
    identifier: "ListAgreementCancellationRequestsOutput",
});
export const LineItemGroupBy = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const InvoiceType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const InvoiceBillingPeriod = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ month: S.Number, year: S.Number })).annotate({
    identifier: "InvoiceBillingPeriod",
});
export const ListAgreementInvoiceLineItemsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.String,
    groupBy: LineItemGroupBy,
    invoiceId: S.optional(S.String),
    invoiceType: S.optional(InvoiceType),
    invoiceBillingPeriod: S.optional(InvoiceBillingPeriod),
    beforeIssuedTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    afterIssuedTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    maxResults: S.optional(S.Number),
    nextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAgreementInvoiceLineItemsInput",
});
export const PricingCurrencyAmount = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    amount: S.optional(S.String),
    maxAdjustmentAmount: S.optional(S.String),
    currencyCode: S.optional(S.String),
})).annotate({
    identifier: "PricingCurrencyAmount",
});
export const InvoicingEntity = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    legalName: S.optional(S.String),
    branchName: S.optional(S.String),
})).annotate({
    identifier: "InvoicingEntity",
});
export const AgreementInvoiceLineItemGroupSummary = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.optional(S.String),
    invoiceId: S.optional(S.String),
    pricingCurrencyAmount: S.optional(PricingCurrencyAmount),
    invoiceBillingPeriod: S.optional(InvoiceBillingPeriod),
    issuedTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    invoiceType: S.optional(InvoiceType),
    invoicingEntity: S.optional(InvoicingEntity),
})).annotate({
    identifier: "AgreementInvoiceLineItemGroupSummary",
});
export const AgreementInvoiceLineItemGroupSummaries = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AgreementInvoiceLineItemGroupSummary);
export const ListAgreementInvoiceLineItemsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementInvoiceLineItemGroupSummaries: S.optional(AgreementInvoiceLineItemGroupSummaries),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAgreementInvoiceLineItemsOutput",
});
export const ListAgreementPaymentRequestsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    partyType: S.String,
    agreementType: S.optional(S.String),
    catalog: S.optional(S.String),
    agreementId: S.optional(S.String),
    status: S.optional(PaymentRequestStatus),
    maxResults: S.optional(S.Number),
    nextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAgreementPaymentRequestsInput",
});
export const PaymentRequestSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    paymentRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    status: S.optional(PaymentRequestStatus),
    name: S.optional(S.String),
    chargeId: S.optional(S.String),
    chargeAmount: S.optional(S.String),
    currencyCode: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "PaymentRequestSummary",
});
export const PaymentRequestSummaryList = /*@__PURE__*/ /*#__PURE__*/ S.Array(PaymentRequestSummary);
export const ListAgreementPaymentRequestsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String),
    items: PaymentRequestSummaryList,
})).annotate({
    identifier: "ListAgreementPaymentRequestsOutput",
});
export const ListBillingAdjustmentRequestsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.optional(S.String),
    status: S.optional(BillingAdjustmentStatus),
    createdAfter: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    createdBefore: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    maxResults: S.optional(S.Number),
    catalog: S.optional(S.String),
    agreementType: S.optional(S.String),
    nextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListBillingAdjustmentRequestsInput",
});
export const BillingAdjustmentSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    billingAdjustmentRequestId: S.String,
    originalInvoiceId: S.String,
    adjustmentAmount: S.String,
    currencyCode: S.String,
    status: BillingAdjustmentStatus,
    agreementId: S.String,
    createdAt: S.Date.pipe(T.TimestampFormat("epoch-seconds")),
    updatedAt: S.Date.pipe(T.TimestampFormat("epoch-seconds")),
    agreementType: S.String,
    catalog: S.String,
})).annotate({
    identifier: "BillingAdjustmentSummary",
});
export const BillingAdjustmentSummaryList = /*@__PURE__*/ /*#__PURE__*/ S.Array(BillingAdjustmentSummary);
export const ListBillingAdjustmentRequestsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String),
    items: BillingAdjustmentSummaryList,
})).annotate({
    identifier: "ListBillingAdjustmentRequestsOutput",
});
export const FilterValueList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Filter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.String), values: S.optional(FilterValueList) })).annotate({ identifier: "Filter" });
export const FilterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Filter);
export const SortOrder = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Sort = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ sortBy: S.optional(S.String), sortOrder: S.optional(SortOrder) })).annotate({ identifier: "Sort" });
export const SearchAgreementsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    catalog: S.optional(S.String),
    filters: S.optional(FilterList),
    sort: S.optional(Sort),
    maxResults: S.optional(S.Number),
    nextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SearchAgreementsInput",
});
export const AgreementViewSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.optional(S.String),
    acceptanceTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    startTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    endTime: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    agreementType: S.optional(S.String),
    acceptor: S.optional(Acceptor),
    proposer: S.optional(Proposer),
    proposalSummary: S.optional(ProposalSummary),
    status: S.optional(AgreementStatus),
})).annotate({
    identifier: "AgreementViewSummary",
});
export const AgreementViewSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AgreementViewSummary);
export const SearchAgreementsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementViewSummaries: S.optional(AgreementViewSummaryList),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "SearchAgreementsOutput",
});
export const SendAgreementCancellationRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.String,
    reasonCode: AgreementCancellationRequestReasonCode,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    description: S.optional(SensitiveString),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SendAgreementCancellationRequestInput",
});
export const SendAgreementCancellationRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    agreementId: S.optional(S.String),
    agreementCancellationRequestId: S.optional(S.String),
    status: S.optional(AgreementCancellationRequestStatus),
    reasonCode: S.optional(AgreementCancellationRequestReasonCode),
    description: S.optional(SensitiveString),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    updatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "SendAgreementCancellationRequestOutput",
});
export const SendAgreementPaymentRequestInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    agreementId: S.String,
    termId: S.String,
    name: S.String,
    chargeAmount: S.String,
    description: S.optional(SensitiveString),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SendAgreementPaymentRequestInput",
});
export const SendAgreementPaymentRequestOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    paymentRequestId: S.optional(S.String),
    agreementId: S.optional(S.String),
    status: S.optional(PaymentRequestStatus),
    name: S.optional(S.String),
    description: S.optional(SensitiveString),
    chargeAmount: S.optional(S.String),
    currencyCode: S.optional(S.String),
    createdAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "SendAgreementPaymentRequestOutput",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { requestId: S.optional(S.String), message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", {
    requestId: S.optional(S.String),
    message: S.optional(S.String),
    resourceId: S.optional(S.String),
    resourceType: S.optional(ResourceType),
}).pipe(C.withConflictError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { requestId: S.optional(S.String), message: S.optional(S.String) }).pipe(C.withServerError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", { requestId: S.optional(S.String), message: S.optional(S.String) }).pipe(C.withThrottlingError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", {
    requestId: S.optional(S.String),
    message: S.optional(S.String),
    reason: S.optional(ValidationExceptionReason),
    fields: S.optional(ValidationExceptionFieldList),
}).pipe(C.withBadRequestError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", {
    requestId: S.optional(S.String),
    message: S.optional(S.String),
    resourceId: S.optional(S.String),
    resourceType: S.optional(ResourceType),
}).pipe(C.withBadRequestError) {
}
/**
 * Allows sellers (proposers) to submit billing adjustment requests for one or more invoices within an agreement. Each entry in the batch specifies an invoice and the adjustment amount. The operation returns successfully created adjustment request IDs and any errors for entries that failed validation.
 *
 * Each entry requires a unique `clientToken` for idempotency. A `ValidationException` is returned if the adjustment amount exceeds the maximum refundable amount for the invoice.
 */
export const batchCreateBillingAdjustmentRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BatchCreateBillingAdjustmentRequestInput,
    output: BatchCreateBillingAdjustmentRequestOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Allows sellers (proposers) to withdraw an existing agreement cancellation request that is in a pending state. Once cancelled, the cancellation request transitions to `CANCELLED` status and can no longer be approved or rejected by the buyer.
 *
 * Only cancellation requests in `PENDING_APPROVAL` status can be cancelled. A `ConflictException` is thrown if the cancellation request is in any other status.
 */
export const cancelAgreementCancellationRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CancelAgreementCancellationRequestInput,
    output: CancelAgreementCancellationRequestOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Allows sellers (proposers) to cancel a payment request that is in `PENDING_APPROVAL` status. Once cancelled, the payment request transitions to `CANCELLED` status and can no longer be accepted or rejected by the buyer.
 *
 * Only payment requests in `PENDING_APPROVAL` status can be cancelled. A `ConflictException` is thrown if the payment request is in any other status.
 */
export const cancelAgreementPaymentRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CancelAgreementPaymentRequestInput,
    output: CancelAgreementPaymentRequestOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Provides details about an agreement, such as the proposer, acceptor, start date, and end date.
 */
export const describeAgreement = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeAgreementInput,
    output: DescribeAgreementOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves detailed information about a specific agreement cancellation request. Both sellers (proposers) and buyers (acceptors) can use this operation to view cancellation requests associated with their agreements.
 *
 * The calling identity must be either the acceptor or proposer of the agreement. A `ResourceNotFoundException` is returned if the cancellation request does not exist.
 */
export const getAgreementCancellationRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAgreementCancellationRequestInput,
    output: GetAgreementCancellationRequestOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves detailed information about a specific payment request. Both sellers (proposers) and buyers (acceptors) can use this operation to view payment requests associated with their agreements. The response includes the current status, charge details, timestamps, and the charge ID if the request has been approved.
 *
 * The calling identity must be either the acceptor or proposer of the payment request. A `ResourceNotFoundException` is returned if the payment request does not exist.
 */
export const getAgreementPaymentRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAgreementPaymentRequestInput,
    output: GetAgreementPaymentRequestOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Obtains details about the terms in an agreement that you participated in as proposer or acceptor.
 *
 * The details include:
 *
 * - `TermType` – The type of term, such as `LegalTerm`, `RenewalTerm`, or `ConfigurableUpfrontPricingTerm`.
 *
 * - `TermID` – The ID of the particular term, which is common between offer and agreement.
 *
 * - `TermPayload` – The key information contained in the term, such as the EULA for `LegalTerm` or pricing and dimensions for various pricing terms, such as `ConfigurableUpfrontPricingTerm` or `UsageBasedPricingTerm`.
 *
 * - `Configuration` – The buyer/acceptor's selection at the time of agreement creation, such as the number of units purchased for a dimension or setting the `EnableAutoRenew` flag.
 */
export const getAgreementTerms = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetAgreementTermsInput,
    output: GetAgreementTermsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves detailed information about a specific billing adjustment request. Sellers (proposers) can use this operation to view the status and details of a billing adjustment request they submitted.
 *
 * A `ResourceNotFoundException` is returned if the billing adjustment request does not exist or the caller does not have permission to access it.
 */
export const getBillingAdjustmentRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBillingAdjustmentRequestInput,
    output: GetBillingAdjustmentRequestOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Lists agreement cancellation requests available to you as a seller or buyer. Both sellers (proposers) and buyers (acceptors) can use this operation to find cancellation requests by specifying their party type and applying optional filters.
 *
 * `PartyType` is a required parameter. A `ValidationException` is returned if `PartyType` is not provided. Pagination is supported through `maxResults` (1-50, default 20) and `nextToken` parameters.
 */
export const listAgreementCancellationRequests = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAgreementCancellationRequestsInput,
    output: ListAgreementCancellationRequestsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "items",
        pageSize: "maxResults",
    },
}));
/**
 * Allows sellers (proposers) to retrieve aggregated billing data from AWS Marketplace agreements using flexible grouping. Supports invoice-level aggregation with filtering by billing period, invoice type, and issued date.
 *
 * The `groupBy` parameter is required and currently supports only `INVOICE_ID` as a value. The `agreementId` parameter is required.
 */
export const listAgreementInvoiceLineItems = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAgreementInvoiceLineItemsInput,
    output: ListAgreementInvoiceLineItemsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "agreementInvoiceLineItemGroupSummaries",
        pageSize: "maxResults",
    },
}));
/**
 * Lists payment requests available to you as a seller or buyer. Both sellers (proposers) and buyers (acceptors) can use this operation to find payment requests by specifying their party type and applying optional parameters.
 *
 * `PartyType` is a required parameter. A `ValidationException` is returned if `PartyType` is not provided. Pagination is supported through `maxResults` (1-50, default 50) and `nextToken` parameters.
 */
export const listAgreementPaymentRequests = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAgreementPaymentRequestsInput,
    output: ListAgreementPaymentRequestsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "items",
        pageSize: "maxResults",
    },
}));
/**
 * Lists billing adjustment requests for a specific agreement. Sellers (proposers) can use this operation to view all billing adjustment requests associated with an agreement.
 *
 * Pagination is supported through `maxResults` and `nextToken` parameters.
 */
export const listBillingAdjustmentRequests = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListBillingAdjustmentRequestsInput,
    output: ListBillingAdjustmentRequestsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "items",
        pageSize: "maxResults",
    },
}));
/**
 * Searches across all agreements that a proposer has in AWS Marketplace. The search returns a list of agreements with basic agreement information.
 *
 * The following filter combinations are supported when the `PartyType` is `Proposer`:
 *
 * - `AgreementType`
 *
 * - `AgreementType` + `EndTime`
 *
 * - `AgreementType` + `ResourceType`
 *
 * - `AgreementType` + `ResourceType` + `EndTime`
 *
 * - `AgreementType` + `ResourceType` + `Status`
 *
 * - `AgreementType` + `ResourceType` + `Status` + `EndTime`
 *
 * - `AgreementType` + `ResourceId`
 *
 * - `AgreementType` + `ResourceId` + `EndTime`
 *
 * - `AgreementType` + `ResourceId` + `Status`
 *
 * - `AgreementType` + `ResourceId` + `Status` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId`
 *
 * - `AgreementType` + `AcceptorAccountId` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `Status`
 *
 * - `AgreementType` + `AcceptorAccountId` + `Status` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `OfferId`
 *
 * - `AgreementType` + `AcceptorAccountId` + `OfferId` + `Status`
 *
 * - `AgreementType` + `AcceptorAccountId` + `OfferId` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `OfferId` + `Status` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceId`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceId` + `Status`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceId` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceId` + `Status` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceType`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceType` + `EndTime`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceType` + `Status`
 *
 * - `AgreementType` + `AcceptorAccountId` + `ResourceType` + `Status` + `EndTime`
 *
 * - `AgreementType` + `Status`
 *
 * - `AgreementType` + `Status` + `EndTime`
 *
 * - `AgreementType` + `OfferId`
 *
 * - `AgreementType` + `OfferId` + `EndTime`
 *
 * - `AgreementType` + `OfferId` + `Status`
 *
 * - `AgreementType` + `OfferId` + `Status` + `EndTime`
 *
 * - `AgreementType` + `OfferSetId`
 *
 * - `AgreementType` + `OfferSetId` + `EndTime`
 *
 * - `AgreementType` + `OfferSetId` + `Status`
 *
 * - `AgreementType` + `OfferSetId` + `Status` + `EndTime`
 *
 * To filter by `EndTime`, you can use either `BeforeEndTime` or `AfterEndTime`. Only `EndTime` is supported for sorting.
 */
export const searchAgreements = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: SearchAgreementsInput,
    output: SearchAgreementsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        pageSize: "maxResults",
    },
}));
/**
 * Allows sellers (proposers) to submit a cancellation request for an active agreement. The cancellation request is created in `PENDING_APPROVAL` status, at which point the buyer can review it.
 */
export const sendAgreementCancellationRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SendAgreementCancellationRequestInput,
    output: SendAgreementCancellationRequestOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Allows sellers (proposers) to submit a payment request to buyers (acceptors) for a specific charge amount for an agreement that includes a `VariablePaymentTerm`. The payment request is created in `PENDING_APPROVAL` status, at which point the buyer can accept or reject it.
 *
 * The agreement must be active and have a `VariablePaymentTerm` to support payment requests. The `chargeAmount` must not exceed the remaining available balance under the `VariablePaymentTerm` `maxTotalChargeAmount`.
 */
export const sendAgreementPaymentRequest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SendAgreementPaymentRequestInput,
    output: SendAgreementPaymentRequestOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
//# sourceMappingURL=marketplace-agreement.js.map