123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662(* 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.signinletapiVersion="2023-01-01"letendpointPrefix="signin"letserviceFullName="AWS Sign-In Service"letsignatureVersion="v4"letprotocol="rest_json"letglobalEndpoint=endpointPrefix^".amazonaws.com"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[]))])moduleString_=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_valueendmoduleOAuth2ErrorCode=structtypenonrect=|TOKEN_EXPIRED|USER_CREDENTIALS_CHANGED|INSUFFICIENT_PERMISSIONS|AUTHCODE_EXPIRED|Server_error|INVALID_REQUEST|Non_static_idofstringletmakei=iletto_string=function|TOKEN_EXPIRED->"TOKEN_EXPIRED"|USER_CREDENTIALS_CHANGED->"USER_CREDENTIALS_CHANGED"|INSUFFICIENT_PERMISSIONS->"INSUFFICIENT_PERMISSIONS"|AUTHCODE_EXPIRED->"AUTHCODE_EXPIRED"|Server_error->"server_error"|INVALID_REQUEST->"INVALID_REQUEST"|Non_static_ids->sletof_string=function|"TOKEN_EXPIRED"->TOKEN_EXPIRED|"USER_CREDENTIALS_CHANGED"->USER_CREDENTIALS_CHANGED|"INSUFFICIENT_PERMISSIONS"->INSUFFICIENT_PERMISSIONS|"AUTHCODE_EXPIRED"->AUTHCODE_EXPIRED|"server_error"->Server_error|"INVALID_REQUEST"->INVALID_REQUEST|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 OAuth2ErrorCode"xml_arg0)letof_jsonj=of_string(string_of_json~kind:"OAuth2ErrorCode"j)letto_json=simple_to_jsonto_valueendmoduleAccessToken=structtypenonrect={accessKeyId:String_.toption[@ocaml.doc"AWS access key ID for temporary credentials"];secretAccessKey:String_.toption[@ocaml.doc"AWS secret access key for temporary credentials"];sessionToken:String_.toption[@ocaml.doc"AWS session token for temporary credentials"]}letmake?accessKeyId=fun?secretAccessKey->fun?sessionToken->fun()->{accessKeyId;secretAccessKey;sessionToken}letto_valuex=structure_to_value[("accessKeyId",(Option.mapx.accessKeyId~f:String_.to_value));("secretAccessKey",(Option.mapx.secretAccessKey~f:String_.to_value));("sessionToken",(Option.mapx.sessionToken~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letsessionToken=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"sessionToken")inletsecretAccessKey=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"secretAccessKey")inletaccessKeyId=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"accessKeyId")inmake?sessionToken?secretAccessKey?accessKeyId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letsessionToken=field_mapjson__"sessionToken"String_.of_jsoninletsecretAccessKey=field_mapjson__"secretAccessKey"String_.of_jsoninletaccessKeyId=field_mapjson__"accessKeyId"String_.of_jsoninmake?sessionToken?secretAccessKey?accessKeyId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"AWS credentials structure containing temporary access credentials The scoped-down, 15 minute duration AWS credentials. Scoping down will be based on CLI policy (CLI team needs to create it). Similar to cloud shell implementation."]moduleExpiresIn=structtypenonrect=int[@@ocaml.doc"Time to expiry in seconds The time to expiry in seconds, for these purposes will be at most 900 (15 minutes)."]letmakei=letopenResultinok_or_failwith((check_int_maxi~max:900)>>=(fun()->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 ExpiresIn"xml_arg0)letof_jsonj=Int.of_float(float_of_json~kind:"an integer"j)letto_json=simple_to_jsonto_valueend[@@ocaml.doc"Time to expiry in seconds The time to expiry in seconds, for these purposes will be at most 900 (15 minutes)."]moduleIdToken=structtypenonrect=string[@@ocaml.doc"ID token containing user identity information Encoded JWT token containing user identity claims and authentication context. Returned only in authorization code redemption responses (grant_type=authorization_code). Contains user identity information such as ARN and other identity claims."]letcontext_="IdToken"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:4096)>>=(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:"IdToken"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"ID token containing user identity information Encoded JWT token containing user identity claims and authentication context. Returned only in authorization code redemption responses (grant_type=authorization_code). Contains user identity information such as ARN and other identity claims."]moduleRefreshToken=structtypenonrect=string[@@ocaml.doc"Encrypted refresh token with cnf.jkt This is the encrypted refresh token returned from auth code redemption. The token content includes cnf.jkt (SHA-256 thumbprint of the presented jwk). Used in subsequent token refresh requests."]letcontext_="RefreshToken"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:2048)>>=(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:"RefreshToken"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"Encrypted refresh token with cnf.jkt This is the encrypted refresh token returned from auth code redemption. The token content includes cnf.jkt (SHA-256 thumbprint of the presented jwk). Used in subsequent token refresh requests."]moduleTokenType=structtypenonrect=string[@@ocaml.doc"Token type parameter indicating credential usage A parameter which indicates to the client how the token must be used. Value is \"aws_sigv4\" (instead of typical \"Bearer\" for other OAuth systems) to indicate that the client must de-serialize the token and use it to generate a signature."]letcontext_="TokenType"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"aws_sigv4");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"TokenType"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"Token type parameter indicating credential usage A parameter which indicates to the client how the token must be used. Value is \"aws_sigv4\" (instead of typical \"Bearer\" for other OAuth systems) to indicate that the client must de-serialize the token and use it to generate a signature."]moduleAuthorizationCode=structtypenonrect=string[@@ocaml.doc"Authorization code received from AWS Sign-In /v1/authorize endpoint The authorization code received from AWS Sign-In from /v1/authorize. Used in auth code redemption flow only."]letcontext_="AuthorizationCode"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:512)>>=(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:"AuthorizationCode"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"Authorization code received from AWS Sign-In /v1/authorize endpoint The authorization code received from AWS Sign-In from /v1/authorize. Used in auth code redemption flow only."]moduleClientId=structtypenonrect=string[@@ocaml.doc"Client identifier pattern for AWS Sign-In devtools clients The ARN used by client as part of Sign-In onboarding. Expected values: arn:aws:signin:::devtools/cross-device (for cross-device devtools login) arn:aws:signin:::devtools/same-device (for same-device devtools login) This will be finalized after consulting with UX as this is visible to end customer."]letcontext_="ClientId"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"arn:aws:signin:::devtools/(cross-device|same-device)");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"ClientId"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"Client identifier pattern for AWS Sign-In devtools clients The ARN used by client as part of Sign-In onboarding. Expected values: arn:aws:signin:::devtools/cross-device (for cross-device devtools login) arn:aws:signin:::devtools/same-device (for same-device devtools login) This will be finalized after consulting with UX as this is visible to end customer."]moduleCodeVerifier=structtypenonrect=string[@@ocaml.doc"PKCE code verifier for OAuth 2.0 security PKCE code verifier to prove possession of the original code challenge. Used to prevent authorization code interception attacks in public clients. Must be 43-128 characters using unreserved characters \\[A-Z\\] / \\[a-z\\] / \\[0-9\\] / \"-\" / \".\" / \"_\" / \"~\""]letcontext_="CodeVerifier"letmakei=letopenResultinok_or_failwith((check_string_mini~min:43)>>=(fun()->(check_string_maxi~max:128)>>=(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:"CodeVerifier"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"PKCE code verifier for OAuth 2.0 security PKCE code verifier to prove possession of the original code challenge. Used to prevent authorization code interception attacks in public clients. Must be 43-128 characters using unreserved characters \\[A-Z\\] / \\[a-z\\] / \\[0-9\\] / \"-\" / \".\" / \"_\" / \"~\""]moduleGrantType=structtypenonrect=string[@@ocaml.doc"OAuth 2.0 grant type parameter For auth code redemption: Must be \"authorization_code\" For token refresh: Must be \"refresh_token\" Based on client_id & grant_type, authn/authz is skipped for CLI endpoints."]letcontext_="GrantType"letmakei=letopenResultinok_or_failwith(check_patterni~pattern:"(authorization_code|refresh_token)");iletof_stringx=xletto_valuex=`Stringxletto_queryv=to_queryto_valuevletto_headerx=xletof_xml=Xml.string_data_exn~context:context_letof_jsonj=string_of_json~kind:"GrantType"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"OAuth 2.0 grant type parameter For auth code redemption: Must be \"authorization_code\" For token refresh: Must be \"refresh_token\" Based on client_id & grant_type, authn/authz is skipped for CLI endpoints."]moduleRedirectUri=structtypenonrect=string[@@ocaml.doc"Redirect URI for OAuth 2.0 flow validation The same redirect URI used in the authorization request. This must match exactly what was sent in the original authorization request for security validation."]letcontext_="RedirectUri"letmakei=letopenResultinok_or_failwith((check_string_maxi~max:2048)>>=(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:"RedirectUri"jletto_json=simple_to_jsonto_valueend[@@ocaml.doc"Redirect URI for OAuth 2.0 flow validation The same redirect URI used in the authorization request. This must match exactly what was sent in the original authorization request for security validation."]moduleAccessDeniedException=structtypenonrect={error:OAuth2ErrorCode.toption[@ocaml.doc"OAuth 2.0 error code indicating the specific type of access denial Can be TOKEN_EXPIRED, AUTHCODE_EXPIRED, USER_CREDENTIALS_CHANGED, or INSUFFICIENT_PERMISSIONS"];message:String_.toption[@ocaml.doc"Detailed message explaining the access denial Provides specific information about why access was denied"]}letmake?error=fun?message->fun()->{error;message}letto_valuex=structure_to_value[("error",(Option.mapx.error~f:OAuth2ErrorCode.to_value));("message",(Option.mapx.message~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"message")inleterror=(Option.map~f:OAuth2ErrorCode.of_xml)(Xml.childxml_arg0"error")inmake?message?error()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"String_.of_jsoninleterror=field_mapjson__"error"OAuth2ErrorCode.of_jsoninmake?message?error()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Error thrown for access denied scenarios with flexible HTTP status mapping Runtime HTTP Status Code Mapping: HTTP 401 (Unauthorized): TOKEN_EXPIRED, AUTHCODE_EXPIRED HTTP 403 (Forbidden): USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS The specific HTTP status code is determined at runtime based on the error enum value. Consumers should use the error field to determine the specific access denial reason."]moduleCreateOAuth2TokenResponseBody=structtypenonrect={accessToken:AccessToken.toption[@ocaml.doc"Scoped-down AWS credentials (15 minute duration) Present for both authorization code redemption and token refresh"];tokenType:TokenType.toption[@ocaml.doc"Token type indicating this is AWS SigV4 credentials Value is \"aws_sigv4\" for both flows"];expiresIn:ExpiresIn.toption[@ocaml.doc"Time to expiry in seconds (maximum 900) Present for both authorization code redemption and token refresh"];refreshToken:RefreshToken.toption[@ocaml.doc"Encrypted refresh token with cnf.jkt (SHA-256 thumbprint of presented jwk) Always present in responses (required for both flows)"];idToken:IdToken.toption[@ocaml.doc"ID token containing user identity information Present only in authorization code redemption response (grant_type=authorization_code) Not included in token refresh responses"]}letmake?accessToken=fun?tokenType->fun?expiresIn->fun?refreshToken->fun?idToken->fun()->{accessToken;tokenType;expiresIn;refreshToken;idToken}letto_valuex=structure_to_value[("accessToken",(Option.mapx.accessToken~f:AccessToken.to_value));("tokenType",(Option.mapx.tokenType~f:TokenType.to_value));("expiresIn",(Option.mapx.expiresIn~f:ExpiresIn.to_value));("refreshToken",(Option.mapx.refreshToken~f:RefreshToken.to_value));("idToken",(Option.mapx.idToken~f:IdToken.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letidToken=(Option.map~f:IdToken.of_xml)(Xml.childxml_arg0"idToken")inletrefreshToken=(Option.map~f:RefreshToken.of_xml)(Xml.childxml_arg0"refreshToken")inletexpiresIn=(Option.map~f:ExpiresIn.of_xml)(Xml.childxml_arg0"expiresIn")inlettokenType=(Option.map~f:TokenType.of_xml)(Xml.childxml_arg0"tokenType")inletaccessToken=(Option.map~f:AccessToken.of_xml)(Xml.childxml_arg0"accessToken")inmake?idToken?refreshToken?expiresIn?tokenType?accessToken()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letidToken=field_mapjson__"idToken"IdToken.of_jsoninletrefreshToken=field_mapjson__"refreshToken"RefreshToken.of_jsoninletexpiresIn=field_mapjson__"expiresIn"ExpiresIn.of_jsoninlettokenType=field_mapjson__"tokenType"TokenType.of_jsoninletaccessToken=field_mapjson__"accessToken"AccessToken.of_jsoninmake?idToken?refreshToken?expiresIn?tokenType?accessToken()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Response body payload for CreateOAuth2Token operation The response content depends on the grant_type from the request: grant_type=authorization_code: Returns all fields including refresh_token and id_token grant_type=refresh_token: Returns access_token, token_type, expires_in, refresh_token (no id_token)"]moduleInternalServerException=structtypenonrect={error:OAuth2ErrorCode.toption[@ocaml.doc"OAuth 2.0 error code indicating server error Will be SERVER_ERROR for internal server errors"];message:String_.toption[@ocaml.doc"Detailed message explaining the server error May include error details for debugging purposes"]}letmake?error=fun?message->fun()->{error;message}letto_valuex=structure_to_value[("error",(Option.mapx.error~f:OAuth2ErrorCode.to_value));("message",(Option.mapx.message~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"message")inleterror=(Option.map~f:OAuth2ErrorCode.of_xml)(Xml.childxml_arg0"error")inmake?message?error()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"String_.of_jsoninleterror=field_mapjson__"error"OAuth2ErrorCode.of_jsoninmake?message?error()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Error thrown when an internal server error occurs HTTP Status Code: 500 Internal Server Error Used for unexpected server-side errors that prevent request processing."]moduleTooManyRequestsError=structtypenonrect={error:OAuth2ErrorCode.toption[@ocaml.doc"OAuth 2.0 error code indicating the specific type of error Will be INVALID_REQUEST for rate limiting scenarios"];message:String_.toption[@ocaml.doc"Detailed message about the rate limiting May include retry-after information or rate limit details"]}letmake?error=fun?message->fun()->{error;message}letto_valuex=structure_to_value[("error",(Option.mapx.error~f:OAuth2ErrorCode.to_value));("message",(Option.mapx.message~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"message")inleterror=(Option.map~f:OAuth2ErrorCode.of_xml)(Xml.childxml_arg0"error")inmake?message?error()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"String_.of_jsoninleterror=field_mapjson__"error"OAuth2ErrorCode.of_jsoninmake?message?error()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Error thrown when rate limit is exceeded HTTP Status Code: 429 Too Many Requests Possible OAuth2ErrorCode values: INVALID_REQUEST: Rate limiting, too many requests, abuse prevention Possible causes: Too many token requests from the same client Rate limiting based on client_id or IP address Abuse prevention mechanisms triggered Service protection against excessive token generation"]moduleValidationException=structtypenonrect={error:OAuth2ErrorCode.toption[@ocaml.doc"OAuth 2.0 error code indicating validation failure Will be INVALID_REQUEST for validation errors"];message:String_.toption[@ocaml.doc"Detailed message explaining the validation failure Provides specific information about which validation failed"]}letmake?error=fun?message->fun()->{error;message}letto_valuex=structure_to_value[("error",(Option.mapx.error~f:OAuth2ErrorCode.to_value));("message",(Option.mapx.message~f:String_.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letmessage=(Option.map~f:String_.of_xml)(Xml.childxml_arg0"message")inleterror=(Option.map~f:OAuth2ErrorCode.of_xml)(Xml.childxml_arg0"error")inmake?message?error()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letmessage=field_mapjson__"message"String_.of_jsoninleterror=field_mapjson__"error"OAuth2ErrorCode.of_jsoninmake?message?error()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Error thrown when request validation fails HTTP Status Code: 400 Bad Request Used for request validation errors such as malformed parameters, missing required fields, or invalid parameter values."]moduleCreateOAuth2TokenRequestBody=structtypenonrect={clientId:ClientId.t[@ocaml.doc"The client identifier (ARN) used during Sign-In onboarding Required for both authorization code and refresh token flows"];grantType:GrantType.t[@ocaml.doc"OAuth 2.0 grant type - determines which flow is used Must be \"authorization_code\" or \"refresh_token\""];code:AuthorizationCode.toption[@ocaml.doc"The authorization code received from /v1/authorize Required only when grant_type=authorization_code"];redirectUri:RedirectUri.toption[@ocaml.doc"The redirect URI that must match the original authorization request Required only when grant_type=authorization_code"];codeVerifier:CodeVerifier.toption[@ocaml.doc"PKCE code verifier to prove possession of the original code challenge Required only when grant_type=authorization_code"];refreshToken:RefreshToken.toption[@ocaml.doc"The refresh token returned from auth_code redemption Required only when grant_type=refresh_token"]}letcontext_="CreateOAuth2TokenRequestBody"letmake?code=fun?redirectUri->fun?codeVerifier->fun?refreshToken->fun~clientId->fun~grantType->fun()->{code;redirectUri;codeVerifier;refreshToken;clientId;grantType}letto_valuex=structure_to_value[("clientId",(Some(ClientId.to_valuex.clientId)));("grantType",(Some(GrantType.to_valuex.grantType)));("code",(Option.mapx.code~f:AuthorizationCode.to_value));("redirectUri",(Option.mapx.redirectUri~f:RedirectUri.to_value));("codeVerifier",(Option.mapx.codeVerifier~f:CodeVerifier.to_value));("refreshToken",(Option.mapx.refreshToken~f:RefreshToken.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=letrefreshToken=(Option.map~f:RefreshToken.of_xml)(Xml.childxml_arg0"refreshToken")inletcodeVerifier=(Option.map~f:CodeVerifier.of_xml)(Xml.childxml_arg0"codeVerifier")inletredirectUri=(Option.map~f:RedirectUri.of_xml)(Xml.childxml_arg0"redirectUri")inletcode=(Option.map~f:AuthorizationCode.of_xml)(Xml.childxml_arg0"code")inletgrantType=GrantType.of_xml(Xml.child_exn~context:context_xml_arg0"grantType")inletclientId=ClientId.of_xml(Xml.child_exn~context:context_xml_arg0"clientId")inmake?refreshToken?codeVerifier?redirectUri?code~grantType~clientId()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=letrefreshToken=field_mapjson__"refreshToken"RefreshToken.of_jsoninletcodeVerifier=field_mapjson__"codeVerifier"CodeVerifier.of_jsoninletredirectUri=field_mapjson__"redirectUri"RedirectUri.of_jsoninletcode=field_mapjson__"code"AuthorizationCode.of_jsoninletgrantType=field_map_exnjson__"grantType"GrantType.of_jsoninletclientId=field_map_exnjson__"clientId"ClientId.of_jsoninmake?refreshToken?codeVerifier?redirectUri?code~grantType~clientId()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Request body payload for CreateOAuth2Token operation The operation type is determined by the grant_type parameter: grant_type=authorization_code: Requires code, redirect_uri, code_verifier grant_type=refresh_token: Requires refresh_token"]moduleCreateOAuth2TokenResponse=structtypenonrect={tokenOutput:CreateOAuth2TokenResponseBody.toption[@ocaml.doc"Flattened token operation outputs The specific response fields depend on the grant_type used in the request"]}typenonrecerror=[`AccessDeniedExceptionofAccessDeniedException.t|`InternalServerExceptionofInternalServerException.t|`TooManyRequestsErrorofTooManyRequestsError.t|`ValidationExceptionofValidationException.t|`Unknown_operation_errorof(string*stringoption)]letmake?tokenOutput=fun()->{tokenOutput}leterror_of_jsonnamejson=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_jsonjson)|"InternalServerException"->`InternalServerException(InternalServerException.of_jsonjson)|"TooManyRequestsError"->`TooManyRequestsError(TooManyRequestsError.of_jsonjson)|"ValidationException"->`ValidationException(ValidationException.of_jsonjson)|name->`Unknown_operation_error(name,(Some(Yojson.Safe.to_stringjson)))leterror_of_xmlnamexml=matchnamewith|"AccessDeniedException"->`AccessDeniedException(AccessDeniedException.of_xmlxml)|"InternalServerException"->`InternalServerException(InternalServerException.of_xmlxml)|"TooManyRequestsError"->`TooManyRequestsError(TooManyRequestsError.of_xmlxml)|"ValidationException"->`ValidationException(ValidationException.of_xmlxml)|name->`Unknown_operation_error(name,(Some(Awso.Xml.to_stringxml)))leterror_to_json:error->Yojson.Safe.t=function|`AccessDeniedExceptione->`Assoc[("error",(`String"AccessDeniedException"));("details",(AccessDeniedException.to_jsone))]|`InternalServerExceptione->`Assoc[("error",(`String"InternalServerException"));("details",(InternalServerException.to_jsone))]|`TooManyRequestsErrore->`Assoc[("error",(`String"TooManyRequestsError"));("details",(TooManyRequestsError.to_jsone))]|`ValidationExceptione->`Assoc[("error",(`String"ValidationException"));("details",(ValidationException.to_jsone))]|`Unknown_operation_error(code,msg)->`Assoc(("error",(`Stringcode))::((matchmsgwith|None->[]|Somem->[("message",(`Stringm))])))letof_header_and_body=((fun(xs,pipe)->make?tokenOutput:(Somepipe)())[@warning"-27"])letto_valuex=structure_to_value[("tokenOutput",(Option.mapx.tokenOutput~f:CreateOAuth2TokenResponseBody.to_value))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettokenOutput=(Option.map~f:CreateOAuth2TokenResponseBody.of_xml)(Xml.childxml_arg0"tokenOutput")inmake?tokenOutput()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettokenOutput=field_mapjson__"tokenOutput"CreateOAuth2TokenResponseBody.of_jsoninmake?tokenOutput()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Output structure for CreateOAuth2Token operation Contains flattened token operation outputs for both authorization code and refresh token flows. The response content depends on the grant_type from the original request."]moduleCreateOAuth2TokenRequest=structtypenonrect={tokenInput:CreateOAuth2TokenRequestBody.t[@ocaml.doc"Flattened token operation inputs The specific operation is determined by grant_type in the request body"]}letcontext_="CreateOAuth2TokenRequest"letmake~tokenInput=fun()->{tokenInput}letof_header_and_body=((fun(xs,pipe)->make~tokenInput:pipe())[@warning"-27"])letto_valuex=structure_to_value[("tokenInput",(Some(CreateOAuth2TokenRequestBody.to_valuex.tokenInput)))]letto_queryv=to_queryto_valuevletof_xmlxml_arg0=lettokenInput=CreateOAuth2TokenRequestBody.of_xml(Xml.child_exn~context:context_xml_arg0"tokenInput")inmake~tokenInput()letof_strings=of_xml(Awso.Xml.parse_responses)[@@warning"-32"]letof_jsonjson__=lettokenInput=field_map_exnjson__"tokenInput"CreateOAuth2TokenRequestBody.of_jsoninmake~tokenInput()letto_jsonv=composed_to_jsonto_valuevend[@@ocaml.doc"Input structure for CreateOAuth2Token operation Contains flattened token operation inputs for both authorization code and refresh token flows. The operation type is determined by the grant_type parameter in the request body."]