1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828(* generated by: awso-codegen generate-all --botocore-data vendor/botocore/botocore/data -o aws --runtime-dir lib/runtime/awso --cli-dir awso-cli *)openAwsoopen!Import[@@@warning"-32"]letservice=Service.meteringmarketplaceletapiVersion="2016-01-14"letendpointPrefix="metering.marketplace"letserviceFullName="AWSMarketplace Metering"letsignatureVersion="v4"letprotocol="json"letglobalEndpoint=endpointPrefix^".amazonaws.com"lettargetPrefix="AWSMPMeteringService"letsimple_to_jsonto_valuex=Botodata.Json.value_to_json_scalar(to_valuex)letcomposed_to_jsonto_valuex=Botodata.Json.value_to_json(to_valuex)letto_queryto_valuex=Client.Query.of_value(to_valuex)letstructure_to_value_auxst~f=letfilter=function|(k,Somev)->Some(k,v)|_->Noneinletpairkv=(k,v)inletdefer_value(k,dv)=pairkdvin((List.filter_mapst~f:filter)|>(List.map~f:defer_value))|>(funx->`Structure(fx))letstructure_to_value=structure_to_value_aux~f:Fn.idletstructure_to_wrapped_value~wrapper~response=structure_to_value_aux~f:(funx->[(wrapper,(`Structurex));(response,(`Structure[]))])moduleTagKey=structtypenonrect=stringletcontext_="TagKey"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:100)>>=(fun()->check_patterni~pattern:"^[a-zA-Z0-9+ -=._:\\/@]+$")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"TagKey"jletto_json=simple_to_jsonto_valueendmoduleTagValue=structtypenonrect=stringletcontext_="TagValue"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:256)>>=(fun()->check_patterni~pattern:"^[a-zA-Z0-9+ -=._:\\/@]+$")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"TagValue"jletto_json=simple_to_jsonto_valueendmoduleTag=structtypenonrect={key:TagKey.t[@ocaml.doc"One part of a key-value pair that makes up a tag. A key is a label that acts like a category for the specific tag values."];value:TagValue.t[@ocaml.doc"One part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null."]}letcontext_="Tag"letmake~key=fun~value->fun()->{key;value}letto_valuex=structure_to_value[("Key",(Some(TagKey.to_valuex.key)));("Value",(Some(TagValue.to_valuex.value)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letvalue=TagValue.of_xml(Xml.child_exn~context:context_xml_arg0"Value")inletkey=TagKey.of_xml(Xml.child_exn~context:context_xml_arg0"Key")inmake~value~key()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letvalue=field_map_exnjson__"Value"TagValue.of_jsoninletkey=field_map_exnjson__"Key"TagKey.of_jsoninmake~value~key()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Metadata assigned to an allocation. Each tag is made up of a key and a value."]moduleAllocatedUsageQuantity=structtypenonrect=intletmakei=letopenResultinok_or_failwith((check_int_maxi~max:2147483647)>>=(fun()->check_int_mini~min:0));iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for AllocatedUsageQuantity"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleTagList=structtypenonrect=Tag.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:5)>>=(fun()->check_list_mini~min:1));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:Tag.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:Tag.of_xml)letof_jsonj=list_of_json~kind:"TagList"~of_json:Tag.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleUsageAllocation=structtypenonrect={allocatedUsageQuantity:AllocatedUsageQuantity.t[@ocaml.doc"The total quantity allocated to this bucket of usage."];tags:TagList.toption[@ocaml.doc"The set of tags that define the bucket of usage. For the bucket of items with no tags, this parameter can be left out."]}letcontext_="UsageAllocation"letmake?tags=fun~allocatedUsageQuantity->fun()->{tags;allocatedUsageQuantity}letto_valuex=structure_to_value[("AllocatedUsageQuantity",(Some(AllocatedUsageQuantity.to_valuex.allocatedUsageQuantity)));("Tags",(Option.mapx.tags~f:TagList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettags=(Option.map~f:TagList.of_xml)(Xml.childxml_arg0"Tags")inletallocatedUsageQuantity=AllocatedUsageQuantity.of_xml(Xml.child_exn~context:context_xml_arg0"AllocatedUsageQuantity")inmake?tags~allocatedUsageQuantity()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettags=field_mapjson__"Tags"TagList.of_jsoninletallocatedUsageQuantity=field_map_exnjson__"AllocatedUsageQuantity"AllocatedUsageQuantity.of_jsoninmake?tags~allocatedUsageQuantity()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Usage allocations allow you to split usage into buckets by tags. Each UsageAllocation indicates the usage quantity for a specific set of tags."]moduleCustomerAWSAccountId=structtypenonrect=stringletcontext_="CustomerAWSAccountId"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:255)>>=(fun()->check_patterni~pattern:"^[0-9]+$")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"CustomerAWSAccountId"jletto_json=simple_to_jsonto_valueendmoduleCustomerIdentifier=structtypenonrect=stringletcontext_="CustomerIdentifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:255)>>=(fun()->check_patterni~pattern:"[\\s\\S]*")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"CustomerIdentifier"jletto_json=simple_to_jsonto_valueendmoduleLicenseArn=structtypenonrect=stringletcontext_="LicenseArn"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"^arn:aws[a-zA-Z-]*:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"LicenseArn"jletto_json=simple_to_jsonto_valueendmoduleTimestamp=structtypenonrect=stringletmakei=iletof_stringx=xletto_valuex=`Timestampxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=string_of_xml~kind:"a timestamp"letof_json=timestamp_of_jsonletto_json=simple_to_jsonto_valueendmoduleUsageAllocations=structtypenonrect=UsageAllocation.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:2500)>>=(fun()->check_list_mini~min:1));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:UsageAllocation.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:UsageAllocation.of_xml)letof_jsonj=list_of_json~kind:"UsageAllocations"~of_json:UsageAllocation.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleUsageDimension=structtypenonrect=stringletcontext_="UsageDimension"letmakei=letopenResultinok_or_failwith((check_string_mini~min:1)>>=(fun()->(check_string_maxi~max:255)>>=(fun()->check_patterni~pattern:"[\\s\\S]+")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"UsageDimension"jletto_json=simple_to_jsonto_valueendmoduleUsageQuantity=structtypenonrect=intletmakei=letopenResultinok_or_failwith((check_int_maxi~max:2147483647)>>=(fun()->check_int_mini~min:0));iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for UsageQuantity"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleString_=structtypenonrect=stringletcontext_="String"letmakei=iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"String"jletto_json=simple_to_jsonto_valueendmoduleUsageRecord=structtypenonrect={timestamp:Timestamp.t[@ocaml.doc"Timestamp, in UTC, for which the usage is being reported. Your application can meter usage for up to six hours in the past. Make sure the timestamp value is not before the start of the software usage."];customerIdentifier:CustomerIdentifier.toption[@ocaml.doc"The CustomerIdentifier is obtained through the ResolveCustomer operation and represents an individual buyer in your application."];dimension:UsageDimension.t[@ocaml.doc"During the process of registering a product on Amazon Web Services Marketplace, dimensions are specified. These represent different units of value in your application."];quantity:UsageQuantity.toption[@ocaml.doc"The quantity of usage consumed by the customer for the given dimension and time. Defaults to 0 if not specified."];usageAllocations:UsageAllocations.toption[@ocaml.doc"The set of UsageAllocations to submit. The sum of all UsageAllocation quantities must equal the Quantity of the UsageRecord."];customerAWSAccountId:CustomerAWSAccountId.toption[@ocaml.doc"The CustomerAWSAccountId parameter specifies the AWS account ID of the buyer. For existing integrations, to access your CustomerIdentifier to CustomerAWSAccountId mapping, see Account Feeds."];licenseArn:LicenseArn.toption[@ocaml.doc"The LicenseArn is a unique identifier for a specific granted license. These are used for software purchased through Amazon Web Services Marketplace. To access your CustomerAWSAccountId and LicenseArn mapping, visit Agreements Feeds."]}letcontext_="UsageRecord"letmake?customerIdentifier=fun?quantity->fun?usageAllocations->fun?customerAWSAccountId->fun?licenseArn->fun~timestamp->fun~dimension->fun()->{customerIdentifier;quantity;usageAllocations;customerAWSAccountId;licenseArn;timestamp;dimension}letto_valuex=structure_to_value[("Timestamp",(Some(Timestamp.to_valuex.timestamp)));("CustomerIdentifier",(Option.mapx.customerIdentifier~f:CustomerIdentifier.to_value));("Dimension",(Some(UsageDimension.to_valuex.dimension)));("Quantity",(Option.mapx.quantity~f:UsageQuantity.to_value));("UsageAllocations",(Option.mapx.usageAllocations~f:UsageAllocations.to_value));("CustomerAWSAccountId",(Option.mapx.customerAWSAccountId~f:CustomerAWSAccountId.to_value));("LicenseArn",(Option.mapx.licenseArn~f:LicenseArn.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlicenseArn=(Option.map~f:LicenseArn.of_xml)(Xml.childxml_arg0"LicenseArn")inletcustomerAWSAccountId=(Option.map~f:CustomerAWSAccountId.of_xml)(Xml.childxml_arg0"CustomerAWSAccountId")inletusageAllocations=(Option.map~f:UsageAllocations.of_xml)(Xml.childxml_arg0"UsageAllocations")inletquantity=(Option.map~f:UsageQuantity.of_xml)(Xml.childxml_arg0"Quantity")inletdimension=UsageDimension.of_xml(Xml.child_exn~context:context_xml_arg0"Dimension")inletcustomerIdentifier=(Option.map~f:CustomerIdentifier.of_xml)(Xml.childxml_arg0"CustomerIdentifier")inlettimestamp=Timestamp.of_xml(Xml.child_exn~context:context_xml_arg0"Timestamp")inmake?licenseArn?customerAWSAccountId?usageAllocations?quantity~dimension?customerIdentifier~timestamp()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlicenseArn=field_mapjson__"LicenseArn"LicenseArn.of_jsoninletcustomerAWSAccountId=field_mapjson__"CustomerAWSAccountId"CustomerAWSAccountId.of_jsoninletusageAllocations=field_mapjson__"UsageAllocations"UsageAllocations.of_jsoninletquantity=field_mapjson__"Quantity"UsageQuantity.of_jsoninletdimension=field_map_exnjson__"Dimension"UsageDimension.of_jsoninletcustomerIdentifier=field_mapjson__"CustomerIdentifier"CustomerIdentifier.of_jsoninlettimestamp=field_map_exnjson__"Timestamp"Timestamp.of_jsoninmake?licenseArn?customerAWSAccountId?usageAllocations?quantity~dimension?customerIdentifier~timestamp()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A UsageRecord indicates a quantity of usage for a given product, customer, dimension and time. Multiple requests with the same UsageRecords as input will be de-duplicated to prevent double charges."]moduleUsageRecordResultStatus=structtypenonrect=|Success|CustomerNotSubscribed|DuplicateRecord|Non_static_idofstringletmakei=iletto_string=function|Success->"Success"|CustomerNotSubscribed->"CustomerNotSubscribed"|DuplicateRecord->"DuplicateRecord"|Non_static_ids->sletof_string=function|"Success"->Success|"CustomerNotSubscribed"->CustomerNotSubscribed|"DuplicateRecord"->DuplicateRecord|x->Non_static_idxletto_valuex=`Enum(to_stringx)letto_queryv=to_queryto_valuevletto_headerx=to_stringxletof_xmlxml_arg0=of_string(string_of_xml~kind:"enumeration UsageRecordResultStatus"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"UsageRecordResultStatus"j)letto_json=simple_to_jsonto_valueendmoduleErrorMessage=structtypenonrect=stringletcontext_="errorMessage"letmakei=iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"errorMessage"jletto_json=simple_to_jsonto_valueendmoduleUsageRecordResult=structtypenonrect={usageRecord:UsageRecord.toption[@ocaml.doc"The UsageRecord that was part of the BatchMeterUsage request."];meteringRecordId:String_.toption[@ocaml.doc"The MeteringRecordId is a unique identifier for this metering event."];status:UsageRecordResultStatus.toption[@ocaml.doc"The UsageRecordResult Status indicates the status of an individual UsageRecord processed by BatchMeterUsage. Success- The UsageRecord was accepted and honored by BatchMeterUsage. CustomerNotSubscribed- The CustomerIdentifier specified is not able to use your product. The UsageRecord was not honored. There are three causes for this result: The customer identifier is invalid. The customer identifier provided in the metering record does not have an active agreement or subscription with this product. Future UsageRecords for this customer will fail until the customer subscribes to your product. The customer's Amazon Web Services account was suspended. DuplicateRecord- Indicates that the UsageRecord was invalid and not honored. A previously metered UsageRecord had the same customer, dimension, and time, but a different quantity."]}letmake?usageRecord=fun?meteringRecordId->fun?status->fun()->{usageRecord;meteringRecordId;status}letto_valuex=structure_to_value[("UsageRecord",(Option.mapx.usageRecord~f:UsageRecord.to_value));("MeteringRecordId",(Option.mapx.meteringRecordId~f:String_.to_value));("Status",(Option.mapx.status~f:UsageRecordResultStatus.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letstatus=(Option.map~f:UsageRecordResultStatus.of_xml)(Xml.childxml_arg0"Status")inletmeteringRecordId=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"MeteringRecordId")inletusageRecord=(Option.map~f:UsageRecord.of_xml)(Xml.childxml_arg0"UsageRecord")inmake?status?meteringRecordId?usageRecord()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letstatus=field_mapjson__"Status"UsageRecordResultStatus.of_jsoninletmeteringRecordId=field_mapjson__"MeteringRecordId"String_.of_jsoninletusageRecord=field_mapjson__"UsageRecord"UsageRecord.of_jsoninmake?status?meteringRecordId?usageRecord()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A UsageRecordResult indicates the status of a given UsageRecord processed by BatchMeterUsage."]moduleDisabledApiException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The API is disabled in the Region."]moduleExpiredTokenException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The submitted registration token has expired. This can happen if the buyer's browser takes too long to redirect to your page, the buyer has resubmitted the registration token, or your application has held on to the registration token for too long. Your SaaS registration website should redeem this token as soon as it is submitted by the buyer's browser."]moduleInternalServiceErrorException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"An internal error has occurred. Retry your request. If the problem persists, post a message with details on the Amazon Web Services forums."]moduleInvalidTokenException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Registration token is invalid."]moduleProductCode=structtypenonrect=stringletcontext_="ProductCode"letmakei=letopenResultinok_or_failwith((check_string_mini~min:0)>>=(fun()->(check_string_maxi~max:255)>>=(fun()->check_patterni~pattern:"^[-a-zA-Z0-9/=:_.@]*$")));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ProductCode"jletto_json=simple_to_jsonto_valueendmoduleThrottlingException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The calls to the API are throttled."]moduleNonEmptyString=structtypenonrect=stringletcontext_="NonEmptyString"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"[\\s\\S]+");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"NonEmptyString"jletto_json=simple_to_jsonto_valueendmoduleCustomerNotEntitledException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Exception thrown when the customer does not have a valid subscription for the product."]moduleInvalidProductCodeException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The product code passed does not match the product code used for publishing the product."]moduleInvalidPublicKeyVersionException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Public Key version is invalid."]moduleInvalidRegionException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"RegisterUsage must be called in the same Amazon Web Services Region the ECS task was launched in. This prevents a container from hardcoding a Region (e.g. withRegion(\226\128\156us-east-1\226\128\157) when calling RegisterUsage."]modulePlatformNotSupportedException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Amazon Web Services Marketplace does not support metering usage from the underlying platform. Currently, Amazon ECS, Amazon EKS, and Fargate are supported."]moduleNonce=structtypenonrect=stringletcontext_="Nonce"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:255)>>=(fun()->check_patterni~pattern:"[\\s\\S]*"));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"Nonce"jletto_json=simple_to_jsonto_valueendmoduleVersionInteger=structtypenonrect=intletmakei=letopenResultinok_or_failwith(check_int_mini~min:1);iletof_string=Int.of_stringletto_valuex=`Integerxletto_queryv=to_queryto_valuevletto_headerx=Int.to_stringxletof_xmlxml_arg0=Int.of_string(string_of_xml~kind:"an integer for VersionInteger"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueendmoduleDuplicateRequestException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A metering record has already been emitted by the same EC2 instance, ECS task, or EKS pod for the given \\{usageDimension, timestamp\\} with a different usageQuantity."]moduleIdempotencyConflictException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The ClientToken is being used for multiple requests."]moduleInvalidEndpointRegionException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The endpoint being called is in a Amazon Web Services Region different from your EC2 instance, ECS task, or EKS pod. The Region of the Metering Service endpoint and the Amazon Web Services Region of the resource must match."]moduleInvalidTagException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The tag is invalid, or the number of tags is greater than 5."]moduleInvalidUsageAllocationsException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Sum of allocated usage quantities is not equal to the usage quantity."]moduleInvalidUsageDimensionException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The usage dimension does not match one of the UsageDimensions associated with products."]moduleTimestampOutOfBoundsException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The timestamp value passed in the UsageRecord is out of allowed range. For BatchMeterUsage, if any of the records are outside of the allowed range, the entire batch is not processed. You must remove invalid records and try again."]moduleBoolean=structtypenonrect=boolletmakei=iletof_string=Bool.of_stringletto_valuex=`Booleanxletto_queryv=to_queryto_valuevletto_headerx=Bool.to_stringxletof_xmlxml_arg0=Bool.of_string(string_of_xml~kind:"a boolean"xml_arg0)letof_json=bool_of_jsonletto_json=simple_to_jsonto_valueendmoduleClientToken=structtypenonrect=stringletcontext_="ClientToken"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:64)>>=(fun()->check_string_mini~min:1));iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ClientToken"jletto_json=simple_to_jsonto_valueendmoduleInvalidCustomerIdentifierException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"You have metered usage for a CustomerIdentifier that does not exist."]moduleInvalidLicenseException=structtypenonrect={message:ErrorMessage.toption}letmake?message=fun()->{message}letto_valuex=structure_to_value[("message",(Option.mapx.message~f:ErrorMessage.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:ErrorMessage.of_xml)(Xml.childxml_arg0"message")inmake?message()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"ErrorMessage.of_jsoninmake?message()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Ensure the LicenseArn is valid, matches the customer, and usage is within the license activation period."]moduleUsageRecordList=structtypenonrect=UsageRecord.tlistletmakei=letopenResultinok_or_failwith((check_list_maxi~max:25)>>=(fun()->check_list_mini~min:0));iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:UsageRecord.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:UsageRecord.of_xml)letof_jsonj=list_of_json~kind:"UsageRecordList"~of_json:UsageRecord.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleUsageRecordResultList=structtypenonrect=UsageRecordResult.tlistletmakei=iletof_string_=failwithf"of_string is not implemented for List_shape objects"()[@@warning"-32"]letto_valuexs=(xs|>(List.map~f:UsageRecordResult.to_value))|>(funx->`Listx)letto_queryv=to_queryto_valuevletto_header_=failwithf"to_header is not implemented for List_shape objects"()letof_xmlx=make(List.map((Xml.all_childrenx)|>(List.filter~f:(function|`Datas->(matchStdlib.String.trimswith|""->false|_->true)|_->true)))~f:UsageRecordResult.of_xml)letof_jsonj=list_of_json~kind:"UsageRecordResultList"~of_json:UsageRecordResult.of_jsonjletto_jsonv=composed_to_jsonto_valuevendmoduleResolveCustomerResult=structtypenonrect={customerIdentifier:CustomerIdentifier.toption[@ocaml.doc"The CustomerIdentifier is used to identify an individual customer in your application."];productCode:ProductCode.toption[@ocaml.doc"The product code is returned to confirm that the buyer is registering for your product. Subsequent BatchMeterUsage calls should be made using this product code."];customerAWSAccountId:CustomerAWSAccountId.toption[@ocaml.doc"The CustomerAWSAccountId provides the Amazon Web Services account ID associated with the CustomerIdentifier for the individual customer. Calls to BatchMeterUsage require CustomerAWSAccountId for each UsageRecord."];licenseArn:LicenseArn.toption[@ocaml.doc"The LicenseArn is a unique identifier for a specific granted license. These are typically used for software purchased through Amazon Web Services Marketplace. Calls to BatchMeterUsage require LicenseArn for each UsageRecord. Once you receive the CustomerAWSAccountId and LicenseArn in the response, store that for future purposes/API calls/integrations."]}typenonrecerror=[`DisabledApiExceptionofDisabledApiException.t|`ExpiredTokenExceptionofExpiredTokenException.t|`InternalServiceErrorExceptionofInternalServiceErrorException.t|`InvalidTokenExceptionofInvalidTokenException.t|`ThrottlingExceptionofThrottlingException.t|`Unknown_operation_errorof(string*stringoption)]letmake?customerIdentifier=fun?productCode->fun?customerAWSAccountId->fun?licenseArn->fun()->{customerIdentifier;productCode;customerAWSAccountId;licenseArn}leterror_of_jsonnamejson=matchnamewith|"DisabledApiException"->`DisabledApiException(DisabledApiException.of_jsonjson)|"ExpiredTokenException"->`ExpiredTokenException(ExpiredTokenException.of_jsonjson)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_jsonjson)|"InvalidTokenException"->`InvalidTokenException(InvalidTokenException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"DisabledApiException"->`DisabledApiException(DisabledApiException.of_xmlxml)|"ExpiredTokenException"->`ExpiredTokenException(ExpiredTokenException.of_xmlxml)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_xmlxml)|"InvalidTokenException"->`InvalidTokenException(InvalidTokenException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`DisabledApiExceptione->`Assoc[("error",(`String"DisabledApiException"));("details",(DisabledApiException.to_jsone))]|`ExpiredTokenExceptione->`Assoc[("error",(`String"ExpiredTokenException"));("details",(ExpiredTokenException.to_jsone))]|`InternalServiceErrorExceptione->`Assoc[("error",(`String"InternalServiceErrorException"));("details",(InternalServiceErrorException.to_jsone))]|`InvalidTokenExceptione->`Assoc[("error",(`String"InvalidTokenException"));("details",(InvalidTokenException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("CustomerIdentifier",(Option.mapx.customerIdentifier~f:CustomerIdentifier.to_value));("ProductCode",(Option.mapx.productCode~f:ProductCode.to_value));("CustomerAWSAccountId",(Option.mapx.customerAWSAccountId~f:CustomerAWSAccountId.to_value));("LicenseArn",(Option.mapx.licenseArn~f:LicenseArn.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letlicenseArn=(Option.map~f:LicenseArn.of_xml)(Xml.childxml_arg0"LicenseArn")inletcustomerAWSAccountId=(Option.map~f:CustomerAWSAccountId.of_xml)(Xml.childxml_arg0"CustomerAWSAccountId")inletproductCode=(Option.map~f:ProductCode.of_xml)(Xml.childxml_arg0"ProductCode")inletcustomerIdentifier=(Option.map~f:CustomerIdentifier.of_xml)(Xml.childxml_arg0"CustomerIdentifier")inmake?licenseArn?customerAWSAccountId?productCode?customerIdentifier()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letlicenseArn=field_mapjson__"LicenseArn"LicenseArn.of_jsoninletcustomerAWSAccountId=field_mapjson__"CustomerAWSAccountId"CustomerAWSAccountId.of_jsoninletproductCode=field_mapjson__"ProductCode"ProductCode.of_jsoninletcustomerIdentifier=field_mapjson__"CustomerIdentifier"CustomerIdentifier.of_jsoninmake?licenseArn?customerAWSAccountId?productCode?customerIdentifier()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"The result of the ResolveCustomer operation. Contains the CustomerIdentifier along with the CustomerAWSAccountId, ProductCode, and LicenseArn."]moduleResolveCustomerRequest=structtypenonrect={registrationToken:NonEmptyString.t[@ocaml.doc"When a buyer visits your website during the registration process, the buyer submits a registration token through the browser. The registration token is resolved to obtain a CustomerIdentifier along with the CustomerAWSAccountId, ProductCode, and LicenseArn."]}letcontext_="ResolveCustomerRequest"letmake~registrationToken=fun()->{registrationToken}letto_valuex=structure_to_value[("RegistrationToken",(Some(NonEmptyString.to_valuex.registrationToken)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letregistrationToken=NonEmptyString.of_xml(Xml.child_exn~context:context_xml_arg0"RegistrationToken")inmake~registrationToken()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letregistrationToken=field_map_exnjson__"RegistrationToken"NonEmptyString.of_jsoninmake~registrationToken()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains input to the ResolveCustomer operation."]moduleRegisterUsageResult=structtypenonrect={publicKeyRotationTimestamp:Timestamp.toption[@ocaml.doc"(Optional) Only included when public key version has expired"];signature:NonEmptyString.toption[@ocaml.doc"JWT Token"]}typenonrecerror=[`CustomerNotEntitledExceptionofCustomerNotEntitledException.t|`DisabledApiExceptionofDisabledApiException.t|`InternalServiceErrorExceptionofInternalServiceErrorException.t|`InvalidProductCodeExceptionofInvalidProductCodeException.t|`InvalidPublicKeyVersionExceptionofInvalidPublicKeyVersionException.t|`InvalidRegionExceptionofInvalidRegionException.t|`PlatformNotSupportedExceptionofPlatformNotSupportedException.t|`ThrottlingExceptionofThrottlingException.t|`Unknown_operation_errorof(string*stringoption)]letmake?publicKeyRotationTimestamp=fun?signature->fun()->{publicKeyRotationTimestamp;signature}leterror_of_jsonnamejson=matchnamewith|"CustomerNotEntitledException"->`CustomerNotEntitledException(CustomerNotEntitledException.of_jsonjson)|"DisabledApiException"->`DisabledApiException(DisabledApiException.of_jsonjson)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_jsonjson)|"InvalidProductCodeException"->`InvalidProductCodeException(InvalidProductCodeException.of_jsonjson)|"InvalidPublicKeyVersionException"->`InvalidPublicKeyVersionException(InvalidPublicKeyVersionException.of_jsonjson)|"InvalidRegionException"->`InvalidRegionException(InvalidRegionException.of_jsonjson)|"PlatformNotSupportedException"->`PlatformNotSupportedException(PlatformNotSupportedException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"CustomerNotEntitledException"->`CustomerNotEntitledException(CustomerNotEntitledException.of_xmlxml)|"DisabledApiException"->`DisabledApiException(DisabledApiException.of_xmlxml)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_xmlxml)|"InvalidProductCodeException"->`InvalidProductCodeException(InvalidProductCodeException.of_xmlxml)|"InvalidPublicKeyVersionException"->`InvalidPublicKeyVersionException(InvalidPublicKeyVersionException.of_xmlxml)|"InvalidRegionException"->`InvalidRegionException(InvalidRegionException.of_xmlxml)|"PlatformNotSupportedException"->`PlatformNotSupportedException(PlatformNotSupportedException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`CustomerNotEntitledExceptione->`Assoc[("error",(`String"CustomerNotEntitledException"));("details",(CustomerNotEntitledException.to_jsone))]|`DisabledApiExceptione->`Assoc[("error",(`String"DisabledApiException"));("details",(DisabledApiException.to_jsone))]|`InternalServiceErrorExceptione->`Assoc[("error",(`String"InternalServiceErrorException"));("details",(InternalServiceErrorException.to_jsone))]|`InvalidProductCodeExceptione->`Assoc[("error",(`String"InvalidProductCodeException"));("details",(InvalidProductCodeException.to_jsone))]|`InvalidPublicKeyVersionExceptione->`Assoc[("error",(`String"InvalidPublicKeyVersionException"));("details",(InvalidPublicKeyVersionException.to_jsone))]|`InvalidRegionExceptione->`Assoc[("error",(`String"InvalidRegionException"));("details",(InvalidRegionException.to_jsone))]|`PlatformNotSupportedExceptione->`Assoc[("error",(`String"PlatformNotSupportedException"));("details",(PlatformNotSupportedException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("PublicKeyRotationTimestamp",(Option.mapx.publicKeyRotationTimestamp~f:Timestamp.to_value));("Signature",(Option.mapx.signature~f:NonEmptyString.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsignature=(Option.map~f:NonEmptyString.of_xml)(Xml.childxml_arg0"Signature")inletpublicKeyRotationTimestamp=(Option.map~f:Timestamp.of_xml)(Xml.childxml_arg0"PublicKeyRotationTimestamp")inmake?signature?publicKeyRotationTimestamp()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsignature=field_mapjson__"Signature"NonEmptyString.of_jsoninletpublicKeyRotationTimestamp=field_mapjson__"PublicKeyRotationTimestamp"Timestamp.of_jsoninmake?signature?publicKeyRotationTimestamp()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Paid container software products sold through Amazon Web Services Marketplace must integrate with the Amazon Web Services Marketplace Metering Service and call the RegisterUsage operation for software entitlement and metering. Free and BYOL products for Amazon ECS or Amazon EKS aren't required to call RegisterUsage, but you may choose to do so if you would like to receive usage data in your seller reports. The sections below explain the behavior of RegisterUsage. RegisterUsage performs two primary functions: metering and entitlement. Entitlement: RegisterUsage allows you to verify that the customer running your paid software is subscribed to your product on Amazon Web Services Marketplace, enabling you to guard against unauthorized use. Your container image that integrates with RegisterUsage is only required to guard against unauthorized use at container startup, as such a CustomerNotSubscribedException or PlatformNotSupportedException will only be thrown on the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS task instance (e.g. task-id) or Amazon EKS pod will not throw a CustomerNotSubscribedException, even if the customer unsubscribes while the Amazon ECS task or Amazon EKS pod is still running. Metering: RegisterUsage meters software use per ECS task, per hour, or per pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute of usage applies to tasks that are short lived. For example, if a customer has a 10 node Amazon ECS or Amazon EKS cluster and a service configured as a Daemon Set, then Amazon ECS or Amazon EKS will launch a task on all 10 cluster nodes and the customer will be charged for 10 tasks. Software metering is handled by the Amazon Web Services Marketplace metering control plane\226\128\148your software is not required to perform metering-specific actions other than to call RegisterUsage to commence metering. The Amazon Web Services Marketplace metering control plane will also bill customers for running ECS tasks and Amazon EKS pods, regardless of the customer's subscription state, which removes the need for your software to run entitlement checks at runtime. For containers, RegisterUsage should be called immediately at launch. If you don\226\128\153t register the container within the first 6 hours of the launch, Amazon Web Services Marketplace Metering Service doesn\226\128\153t provide any metering guarantees for previous months. Metering will continue, however, for the current month forward until the container ends. RegisterUsage is for metering paid hourly container products. For Amazon Web Services Regions that support RegisterUsage, see RegisterUsage Region support."]moduleRegisterUsageRequest=structtypenonrect={productCode:ProductCode.t[@ocaml.doc"Product code is used to uniquely identify a product in Amazon Web Services Marketplace. The product code should be the same as the one used during the publishing of a new product."];publicKeyVersion:VersionInteger.t[@ocaml.doc"Public Key Version provided by Amazon Web Services Marketplace"];nonce:Nonce.toption[@ocaml.doc"(Optional) To scope down the registration to a specific running software instance and guard against replay attacks."]}letcontext_="RegisterUsageRequest"letmake?nonce=fun~productCode->fun~publicKeyVersion->fun()->{nonce;productCode;publicKeyVersion}letto_valuex=structure_to_value[("ProductCode",(Some(ProductCode.to_valuex.productCode)));("PublicKeyVersion",(Some(VersionInteger.to_valuex.publicKeyVersion)));("Nonce",(Option.mapx.nonce~f:Nonce.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letnonce=(Option.map~f:Nonce.of_xml)(Xml.childxml_arg0"Nonce")inletpublicKeyVersion=VersionInteger.of_xml(Xml.child_exn~context:context_xml_arg0"PublicKeyVersion")inletproductCode=ProductCode.of_xml(Xml.child_exn~context:context_xml_arg0"ProductCode")inmake?nonce~publicKeyVersion~productCode()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letnonce=field_mapjson__"Nonce"Nonce.of_jsoninletpublicKeyVersion=field_map_exnjson__"PublicKeyVersion"VersionInteger.of_jsoninletproductCode=field_map_exnjson__"ProductCode"ProductCode.of_jsoninmake?nonce~publicKeyVersion~productCode()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Paid container software products sold through Amazon Web Services Marketplace must integrate with the Amazon Web Services Marketplace Metering Service and call the RegisterUsage operation for software entitlement and metering. Free and BYOL products for Amazon ECS or Amazon EKS aren't required to call RegisterUsage, but you may choose to do so if you would like to receive usage data in your seller reports. The sections below explain the behavior of RegisterUsage. RegisterUsage performs two primary functions: metering and entitlement. Entitlement: RegisterUsage allows you to verify that the customer running your paid software is subscribed to your product on Amazon Web Services Marketplace, enabling you to guard against unauthorized use. Your container image that integrates with RegisterUsage is only required to guard against unauthorized use at container startup, as such a CustomerNotSubscribedException or PlatformNotSupportedException will only be thrown on the initial call to RegisterUsage. Subsequent calls from the same Amazon ECS task instance (e.g. task-id) or Amazon EKS pod will not throw a CustomerNotSubscribedException, even if the customer unsubscribes while the Amazon ECS task or Amazon EKS pod is still running. Metering: RegisterUsage meters software use per ECS task, per hour, or per pod for Amazon EKS with usage prorated to the second. A minimum of 1 minute of usage applies to tasks that are short lived. For example, if a customer has a 10 node Amazon ECS or Amazon EKS cluster and a service configured as a Daemon Set, then Amazon ECS or Amazon EKS will launch a task on all 10 cluster nodes and the customer will be charged for 10 tasks. Software metering is handled by the Amazon Web Services Marketplace metering control plane\226\128\148your software is not required to perform metering-specific actions other than to call RegisterUsage to commence metering. The Amazon Web Services Marketplace metering control plane will also bill customers for running ECS tasks and Amazon EKS pods, regardless of the customer's subscription state, which removes the need for your software to run entitlement checks at runtime. For containers, RegisterUsage should be called immediately at launch. If you don\226\128\153t register the container within the first 6 hours of the launch, Amazon Web Services Marketplace Metering Service doesn\226\128\153t provide any metering guarantees for previous months. Metering will continue, however, for the current month forward until the container ends. RegisterUsage is for metering paid hourly container products. For Amazon Web Services Regions that support RegisterUsage, see RegisterUsage Region support."]moduleMeterUsageResult=structtypenonrect={meteringRecordId:String_.toption[@ocaml.doc"Metering record id."]}typenonrecerror=[`CustomerNotEntitledExceptionofCustomerNotEntitledException.t|`DuplicateRequestExceptionofDuplicateRequestException.t|`IdempotencyConflictExceptionofIdempotencyConflictException.t|`InternalServiceErrorExceptionofInternalServiceErrorException.t|`InvalidEndpointRegionExceptionofInvalidEndpointRegionException.t|`InvalidProductCodeExceptionofInvalidProductCodeException.t|`InvalidTagExceptionofInvalidTagException.t|`InvalidUsageAllocationsExceptionofInvalidUsageAllocationsException.t|`InvalidUsageDimensionExceptionofInvalidUsageDimensionException.t|`ThrottlingExceptionofThrottlingException.t|`TimestampOutOfBoundsExceptionofTimestampOutOfBoundsException.t|`Unknown_operation_errorof(string*stringoption)]letmake?meteringRecordId=fun()->{meteringRecordId}leterror_of_jsonnamejson=matchnamewith|"CustomerNotEntitledException"->`CustomerNotEntitledException(CustomerNotEntitledException.of_jsonjson)|"DuplicateRequestException"->`DuplicateRequestException(DuplicateRequestException.of_jsonjson)|"IdempotencyConflictException"->`IdempotencyConflictException(IdempotencyConflictException.of_jsonjson)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_jsonjson)|"InvalidEndpointRegionException"->`InvalidEndpointRegionException(InvalidEndpointRegionException.of_jsonjson)|"InvalidProductCodeException"->`InvalidProductCodeException(InvalidProductCodeException.of_jsonjson)|"InvalidTagException"->`InvalidTagException(InvalidTagException.of_jsonjson)|"InvalidUsageAllocationsException"->`InvalidUsageAllocationsException(InvalidUsageAllocationsException.of_jsonjson)|"InvalidUsageDimensionException"->`InvalidUsageDimensionException(InvalidUsageDimensionException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"TimestampOutOfBoundsException"->`TimestampOutOfBoundsException(TimestampOutOfBoundsException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"CustomerNotEntitledException"->`CustomerNotEntitledException(CustomerNotEntitledException.of_xmlxml)|"DuplicateRequestException"->`DuplicateRequestException(DuplicateRequestException.of_xmlxml)|"IdempotencyConflictException"->`IdempotencyConflictException(IdempotencyConflictException.of_xmlxml)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_xmlxml)|"InvalidEndpointRegionException"->`InvalidEndpointRegionException(InvalidEndpointRegionException.of_xmlxml)|"InvalidProductCodeException"->`InvalidProductCodeException(InvalidProductCodeException.of_xmlxml)|"InvalidTagException"->`InvalidTagException(InvalidTagException.of_xmlxml)|"InvalidUsageAllocationsException"->`InvalidUsageAllocationsException(InvalidUsageAllocationsException.of_xmlxml)|"InvalidUsageDimensionException"->`InvalidUsageDimensionException(InvalidUsageDimensionException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"TimestampOutOfBoundsException"->`TimestampOutOfBoundsException(TimestampOutOfBoundsException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`CustomerNotEntitledExceptione->`Assoc[("error",(`String"CustomerNotEntitledException"));("details",(CustomerNotEntitledException.to_jsone))]|`DuplicateRequestExceptione->`Assoc[("error",(`String"DuplicateRequestException"));("details",(DuplicateRequestException.to_jsone))]|`IdempotencyConflictExceptione->`Assoc[("error",(`String"IdempotencyConflictException"));("details",(IdempotencyConflictException.to_jsone))]|`InternalServiceErrorExceptione->`Assoc[("error",(`String"InternalServiceErrorException"));("details",(InternalServiceErrorException.to_jsone))]|`InvalidEndpointRegionExceptione->`Assoc[("error",(`String"InvalidEndpointRegionException"));("details",(InvalidEndpointRegionException.to_jsone))]|`InvalidProductCodeExceptione->`Assoc[("error",(`String"InvalidProductCodeException"));("details",(InvalidProductCodeException.to_jsone))]|`InvalidTagExceptione->`Assoc[("error",(`String"InvalidTagException"));("details",(InvalidTagException.to_jsone))]|`InvalidUsageAllocationsExceptione->`Assoc[("error",(`String"InvalidUsageAllocationsException"));("details",(InvalidUsageAllocationsException.to_jsone))]|`InvalidUsageDimensionExceptione->`Assoc[("error",(`String"InvalidUsageDimensionException"));("details",(InvalidUsageDimensionException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`TimestampOutOfBoundsExceptione->`Assoc[("error",(`String"TimestampOutOfBoundsException"));("details",(TimestampOutOfBoundsException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("MeteringRecordId",(Option.mapx.meteringRecordId~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmeteringRecordId=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"MeteringRecordId")inmake?meteringRecordId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmeteringRecordId=field_mapjson__"MeteringRecordId"String_.of_jsoninmake?meteringRecordId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"As a seller, your software hosted in the buyer's Amazon Web Services account uses this API action to emit metering records directly to Amazon Web Services Marketplace. You must use the following buyer Amazon Web Services account credentials to sign the API request. For Amazon EC2 deployments, your software must use the IAM role for Amazon EC2 to sign the API call for MeterUsage API operation. For Amazon EKS deployments, your software must use IAM roles for service accounts (IRSA) to sign the API call for the MeterUsage API operation. Using EKS Pod Identity, the node role, or long-term access keys is not supported. For Amazon ECS deployments, your software must use Amazon ECS task IAM role to sign the API call for the MeterUsage API operation. Using the node role or long-term access keys are not supported. For Amazon Bedrock AgentCore Runtime deployments, your software must use the AgentCore Runtime execution role to sign the API call for the MeterUsage API operation. Long-term access keys are not supported. The handling of MeterUsage requests varies between Amazon Bedrock AgentCore Runtime and non-Amazon Bedrock AgentCore deployments. For non-Amazon Bedrock AgentCore Runtime deployments, you can only report usage once per hour for each dimension. For AMI-based products, this is per dimension and per EC2 instance. For container products, this is per dimension and per ECS task or EKS pod. You can't modify values after they're recorded. If you report usage before a current hour ends, you will be unable to report additional usage until the next hour begins. The Timestamp request parameter is rounded down to the hour and used to enforce this once-per-hour rule for idempotency. For requests that are identical after the Timestamp is rounded down, the API is idempotent and returns the metering record ID. For Amazon Bedrock AgentCore Runtime deployments, you can report usage multiple times per hour for the same dimension. You do not need to aggregate metering records by the hour. You must include an idempotency token in the ClientToken request parameter. If using an Amazon SDK or the Amazon Web Services CLI, you must use the latest version which automatically includes an idempotency token in the ClientToken request parameter so that the request is processed successfully. The Timestamp request parameter is not rounded down to the hour and is not used for duplicate validation. Requests with duplicate Timestamps are aggregated as long as the ClientToken is unique. If you submit records more than six hours after events occur, the records won't be accepted. The timestamp in your request determines when an event is recorded. You can optionally include multiple usage allocations, to provide customers with usage data split into buckets by tags that you define or allow the customer to define. For Amazon Web Services Regions that support MeterUsage, see MeterUsage Region support for Amazon EC2 and MeterUsage Region support for Amazon ECS and Amazon EKS."]moduleMeterUsageRequest=structtypenonrect={productCode:ProductCode.t[@ocaml.doc"Product code is used to uniquely identify a product in Amazon Web Services Marketplace. The product code should be the same as the one used during the publishing of a new product."];timestamp:Timestamp.t[@ocaml.doc"Timestamp, in UTC, for which the usage is being reported. Your application can meter usage for up to six hours in the past. Make sure the timestamp value is not before the start of the software usage."];usageDimension:UsageDimension.t[@ocaml.doc"It will be one of the fcp dimension name provided during the publishing of the product."];usageQuantity:UsageQuantity.toption[@ocaml.doc"Consumption value for the hour. Defaults to 0 if not specified."];dryRun:Boolean.toption[@ocaml.doc"Checks whether you have the permissions required for the action, but does not make the request. If you have the permissions, the request returns DryRunOperation; otherwise, it returns UnauthorizedException. Defaults to false if not specified."];usageAllocations:UsageAllocations.toption[@ocaml.doc"The set of UsageAllocations to submit. The sum of all UsageAllocation quantities must equal the UsageQuantity of the MeterUsage request, and each UsageAllocation must have a unique set of tags (include no tags)."];clientToken:ClientToken.toption[@ocaml.doc"Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value. If you don't provide this value, then Amazon Web Services generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotencyConflictException error."]}letcontext_="MeterUsageRequest"letmake?usageQuantity=fun?dryRun->fun?usageAllocations->fun?clientToken->fun~productCode->fun~timestamp->fun~usageDimension->fun()->{usageQuantity;dryRun;usageAllocations;clientToken;productCode;timestamp;usageDimension}letto_valuex=structure_to_value[("ProductCode",(Some(ProductCode.to_valuex.productCode)));("Timestamp",(Some(Timestamp.to_valuex.timestamp)));("UsageDimension",(Some(UsageDimension.to_valuex.usageDimension)));("UsageQuantity",(Option.mapx.usageQuantity~f:UsageQuantity.to_value));("DryRun",(Option.mapx.dryRun~f:Boolean.to_value));("UsageAllocations",(Option.mapx.usageAllocations~f:UsageAllocations.to_value));("ClientToken",(Option.mapx.clientToken~f:ClientToken.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letclientToken=(Option.map~f:ClientToken.of_xml)(Xml.childxml_arg0"ClientToken")inletusageAllocations=(Option.map~f:UsageAllocations.of_xml)(Xml.childxml_arg0"UsageAllocations")inletdryRun=(Option.map~f:Boolean.of_xml)(Xml.childxml_arg0"DryRun")inletusageQuantity=(Option.map~f:UsageQuantity.of_xml)(Xml.childxml_arg0"UsageQuantity")inletusageDimension=UsageDimension.of_xml(Xml.child_exn~context:context_xml_arg0"UsageDimension")inlettimestamp=Timestamp.of_xml(Xml.child_exn~context:context_xml_arg0"Timestamp")inletproductCode=ProductCode.of_xml(Xml.child_exn~context:context_xml_arg0"ProductCode")inmake?clientToken?usageAllocations?dryRun?usageQuantity~usageDimension~timestamp~productCode()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letclientToken=field_mapjson__"ClientToken"ClientToken.of_jsoninletusageAllocations=field_mapjson__"UsageAllocations"UsageAllocations.of_jsoninletdryRun=field_mapjson__"DryRun"Boolean.of_jsoninletusageQuantity=field_mapjson__"UsageQuantity"UsageQuantity.of_jsoninletusageDimension=field_map_exnjson__"UsageDimension"UsageDimension.of_jsoninlettimestamp=field_map_exnjson__"Timestamp"Timestamp.of_jsoninletproductCode=field_map_exnjson__"ProductCode"ProductCode.of_jsoninmake?clientToken?usageAllocations?dryRun?usageQuantity~usageDimension~timestamp~productCode()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"As a seller, your software hosted in the buyer's Amazon Web Services account uses this API action to emit metering records directly to Amazon Web Services Marketplace. You must use the following buyer Amazon Web Services account credentials to sign the API request. For Amazon EC2 deployments, your software must use the IAM role for Amazon EC2 to sign the API call for MeterUsage API operation. For Amazon EKS deployments, your software must use IAM roles for service accounts (IRSA) to sign the API call for the MeterUsage API operation. Using EKS Pod Identity, the node role, or long-term access keys is not supported. For Amazon ECS deployments, your software must use Amazon ECS task IAM role to sign the API call for the MeterUsage API operation. Using the node role or long-term access keys are not supported. For Amazon Bedrock AgentCore Runtime deployments, your software must use the AgentCore Runtime execution role to sign the API call for the MeterUsage API operation. Long-term access keys are not supported. The handling of MeterUsage requests varies between Amazon Bedrock AgentCore Runtime and non-Amazon Bedrock AgentCore deployments. For non-Amazon Bedrock AgentCore Runtime deployments, you can only report usage once per hour for each dimension. For AMI-based products, this is per dimension and per EC2 instance. For container products, this is per dimension and per ECS task or EKS pod. You can't modify values after they're recorded. If you report usage before a current hour ends, you will be unable to report additional usage until the next hour begins. The Timestamp request parameter is rounded down to the hour and used to enforce this once-per-hour rule for idempotency. For requests that are identical after the Timestamp is rounded down, the API is idempotent and returns the metering record ID. For Amazon Bedrock AgentCore Runtime deployments, you can report usage multiple times per hour for the same dimension. You do not need to aggregate metering records by the hour. You must include an idempotency token in the ClientToken request parameter. If using an Amazon SDK or the Amazon Web Services CLI, you must use the latest version which automatically includes an idempotency token in the ClientToken request parameter so that the request is processed successfully. The Timestamp request parameter is not rounded down to the hour and is not used for duplicate validation. Requests with duplicate Timestamps are aggregated as long as the ClientToken is unique. If you submit records more than six hours after events occur, the records won't be accepted. The timestamp in your request determines when an event is recorded. You can optionally include multiple usage allocations, to provide customers with usage data split into buckets by tags that you define or allow the customer to define. For Amazon Web Services Regions that support MeterUsage, see MeterUsage Region support for Amazon EC2 and MeterUsage Region support for Amazon ECS and Amazon EKS."]moduleBatchMeterUsageResult=structtypenonrect={results:UsageRecordResultList.toption[@ocaml.doc"Contains all UsageRecords processed by BatchMeterUsage. These records were either honored by Amazon Web Services Marketplace Metering Service or were invalid. Invalid records should be fixed before being resubmitted."];unprocessedRecords:UsageRecordList.toption[@ocaml.doc"Contains all UsageRecords that were not processed by BatchMeterUsage. This is a list of UsageRecords. You can retry the failed request by making another BatchMeterUsage call with this list as input in the BatchMeterUsageRequest."]}typenonrecerror=[`DisabledApiExceptionofDisabledApiException.t|`InternalServiceErrorExceptionofInternalServiceErrorException.t|`InvalidCustomerIdentifierExceptionofInvalidCustomerIdentifierException.t|`InvalidLicenseExceptionofInvalidLicenseException.t|`InvalidProductCodeExceptionofInvalidProductCodeException.t|`InvalidTagExceptionofInvalidTagException.t|`InvalidUsageAllocationsExceptionofInvalidUsageAllocationsException.t|`InvalidUsageDimensionExceptionofInvalidUsageDimensionException.t|`ThrottlingExceptionofThrottlingException.t|`TimestampOutOfBoundsExceptionofTimestampOutOfBoundsException.t|`Unknown_operation_errorof(string*stringoption)]letmake?results=fun?unprocessedRecords->fun()->{results;unprocessedRecords}leterror_of_jsonnamejson=matchnamewith|"DisabledApiException"->`DisabledApiException(DisabledApiException.of_jsonjson)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_jsonjson)|"InvalidCustomerIdentifierException"->`InvalidCustomerIdentifierException(InvalidCustomerIdentifierException.of_jsonjson)|"InvalidLicenseException"->`InvalidLicenseException(InvalidLicenseException.of_jsonjson)|"InvalidProductCodeException"->`InvalidProductCodeException(InvalidProductCodeException.of_jsonjson)|"InvalidTagException"->`InvalidTagException(InvalidTagException.of_jsonjson)|"InvalidUsageAllocationsException"->`InvalidUsageAllocationsException(InvalidUsageAllocationsException.of_jsonjson)|"InvalidUsageDimensionException"->`InvalidUsageDimensionException(InvalidUsageDimensionException.of_jsonjson)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_jsonjson)|"TimestampOutOfBoundsException"->`TimestampOutOfBoundsException(TimestampOutOfBoundsException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"DisabledApiException"->`DisabledApiException(DisabledApiException.of_xmlxml)|"InternalServiceErrorException"->`InternalServiceErrorException(InternalServiceErrorException.of_xmlxml)|"InvalidCustomerIdentifierException"->`InvalidCustomerIdentifierException(InvalidCustomerIdentifierException.of_xmlxml)|"InvalidLicenseException"->`InvalidLicenseException(InvalidLicenseException.of_xmlxml)|"InvalidProductCodeException"->`InvalidProductCodeException(InvalidProductCodeException.of_xmlxml)|"InvalidTagException"->`InvalidTagException(InvalidTagException.of_xmlxml)|"InvalidUsageAllocationsException"->`InvalidUsageAllocationsException(InvalidUsageAllocationsException.of_xmlxml)|"InvalidUsageDimensionException"->`InvalidUsageDimensionException(InvalidUsageDimensionException.of_xmlxml)|"ThrottlingException"->`ThrottlingException(ThrottlingException.of_xmlxml)|"TimestampOutOfBoundsException"->`TimestampOutOfBoundsException(TimestampOutOfBoundsException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`DisabledApiExceptione->`Assoc[("error",(`String"DisabledApiException"));("details",(DisabledApiException.to_jsone))]|`InternalServiceErrorExceptione->`Assoc[("error",(`String"InternalServiceErrorException"));("details",(InternalServiceErrorException.to_jsone))]|`InvalidCustomerIdentifierExceptione->`Assoc[("error",(`String"InvalidCustomerIdentifierException"));("details",(InvalidCustomerIdentifierException.to_jsone))]|`InvalidLicenseExceptione->`Assoc[("error",(`String"InvalidLicenseException"));("details",(InvalidLicenseException.to_jsone))]|`InvalidProductCodeExceptione->`Assoc[("error",(`String"InvalidProductCodeException"));("details",(InvalidProductCodeException.to_jsone))]|`InvalidTagExceptione->`Assoc[("error",(`String"InvalidTagException"));("details",(InvalidTagException.to_jsone))]|`InvalidUsageAllocationsExceptione->`Assoc[("error",(`String"InvalidUsageAllocationsException"));("details",(InvalidUsageAllocationsException.to_jsone))]|`InvalidUsageDimensionExceptione->`Assoc[("error",(`String"InvalidUsageDimensionException"));("details",(InvalidUsageDimensionException.to_jsone))]|`ThrottlingExceptione->`Assoc[("error",(`String"ThrottlingException"));("details",(ThrottlingException.to_jsone))]|`TimestampOutOfBoundsExceptione->`Assoc[("error",(`String"TimestampOutOfBoundsException"));("details",(TimestampOutOfBoundsException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letto_valuex=structure_to_value[("Results",(Option.mapx.results~f:UsageRecordResultList.to_value));("UnprocessedRecords",(Option.mapx.unprocessedRecords~f:UsageRecordList.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letunprocessedRecords=(Option.map~f:UsageRecordList.of_xml)(Xml.childxml_arg0"UnprocessedRecords")inletresults=(Option.map~f:UsageRecordResultList.of_xml)(Xml.childxml_arg0"Results")inmake?unprocessedRecords?results()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letunprocessedRecords=field_mapjson__"UnprocessedRecords"UsageRecordList.of_jsoninletresults=field_mapjson__"Results"UsageRecordResultList.of_jsoninmake?unprocessedRecords?results()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Contains the UsageRecords processed by BatchMeterUsage and any records that have failed due to transient error."]moduleBatchMeterUsageRequest=structtypenonrect={usageRecords:UsageRecordList.t[@ocaml.doc"The set of UsageRecords to submit. BatchMeterUsage accepts up to 25 UsageRecords at a time."];productCode:ProductCode.toption[@ocaml.doc"Product code is used to uniquely identify a product in Amazon Web Services Marketplace. The product code should be the same as the one used during the publishing of a new product."]}letcontext_="BatchMeterUsageRequest"letmake?productCode=fun~usageRecords->fun()->{productCode;usageRecords}letto_valuex=structure_to_value[("UsageRecords",(Some(UsageRecordList.to_valuex.usageRecords)));("ProductCode",(Option.mapx.productCode~f:ProductCode.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letproductCode=(Option.map~f:ProductCode.of_xml)(Xml.childxml_arg0"ProductCode")inletusageRecords=UsageRecordList.of_xml(Xml.child_exn~context:context_xml_arg0"UsageRecords")inmake?productCode~usageRecords()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letproductCode=field_mapjson__"ProductCode"ProductCode.of_jsoninletusageRecords=field_map_exnjson__"UsageRecords"UsageRecordList.of_jsoninmake?productCode~usageRecords()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"A BatchMeterUsageRequest contains UsageRecords, which indicate quantities of usage within your application."]